Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,12 +62,12 @@ def transliterate_to_sinhala(text):
|
|
| 62 |
# device_map="auto",
|
| 63 |
# )
|
| 64 |
|
| 65 |
-
pipe1 = pipeline("text-generation", model="unsloth/gemma-2b-it")
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
# def conversation_predict(text):
|
| 70 |
-
|
| 71 |
# pipe = pipeline(
|
| 72 |
# "text-generation",
|
| 73 |
# model=model,
|
|
@@ -135,8 +135,8 @@ def respond(
|
|
| 135 |
|
| 136 |
messages.append({"role": "user", "content": message})
|
| 137 |
|
| 138 |
-
|
| 139 |
-
response = pipe1({"role": "user", "content": message})
|
| 140 |
|
| 141 |
yield response
|
| 142 |
|
|
|
|
| 62 |
# device_map="auto",
|
| 63 |
# )
|
| 64 |
|
| 65 |
+
# pipe1 = pipeline("text-generation", model="unsloth/gemma-2b-it")
|
| 66 |
|
| 67 |
+
client = InferenceClient("google/gemma-2b-it")
|
| 68 |
|
| 69 |
# def conversation_predict(text):
|
| 70 |
+
return client.text_generation(text, return_full_text=False)
|
| 71 |
# pipe = pipeline(
|
| 72 |
# "text-generation",
|
| 73 |
# model=model,
|
|
|
|
| 135 |
|
| 136 |
messages.append({"role": "user", "content": message})
|
| 137 |
|
| 138 |
+
response = ai_predicted(message)
|
| 139 |
+
# response = pipe1({"role": "user", "content": message})
|
| 140 |
|
| 141 |
yield response
|
| 142 |
|