anniesaxena commited on
Commit
fee2113
·
verified ·
1 Parent(s): 7a3a684

Update app.py

Browse files

Fixing Bugs that were caused by Hugging Face updating their syntax

Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -56,8 +56,11 @@ custom_theme = gr.themes.Soft(
56
  )
57
 
58
 
59
-
60
- client = InferenceClient("google/gemma-2-2b-it")
 
 
 
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