Spaces:
Sleeping
Sleeping
Update app.py
Browse filesFixing Bugs that were caused by Hugging Face updating their syntax
app.py
CHANGED
|
@@ -56,8 +56,11 @@ custom_theme = gr.themes.Soft(
|
|
| 56 |
)
|
| 57 |
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
|
| 63 |
def respond(message, history):
|
|
@@ -84,9 +87,10 @@ def respond(message, history):
|
|
| 84 |
|
| 85 |
# iterate through each message in the method
|
| 86 |
for message in client.chat_completion(
|
| 87 |
-
messages,
|
|
|
|
| 88 |
max_tokens=500,
|
| 89 |
-
temperature=.1,
|
| 90 |
stream=True):
|
| 91 |
# add the tokens to the output content
|
| 92 |
token = message.choices[0].delta.content # capture the most recent toke
|
|
|
|
| 56 |
)
|
| 57 |
|
| 58 |
|
| 59 |
+
client = InferenceClient(
|
| 60 |
+
model="google/gemma-2-2b-it",
|
| 61 |
+
provider="auto",
|
| 62 |
+
api_key=os.environ["HF_TOKEN"]
|
| 63 |
+
)
|
| 64 |
|
| 65 |
|
| 66 |
def respond(message, history):
|
|
|
|
| 87 |
|
| 88 |
# iterate through each message in the method
|
| 89 |
for message in client.chat_completion(
|
| 90 |
+
messages=messages,
|
| 91 |
+
model="google/gemma-2-2b-it",
|
| 92 |
max_tokens=500,
|
| 93 |
+
temperature=0.1,
|
| 94 |
stream=True):
|
| 95 |
# add the tokens to the output content
|
| 96 |
token = message.choices[0].delta.content # capture the most recent toke
|