wangzhang commited on
Commit
675a652
·
1 Parent(s): 1798def

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -4,11 +4,13 @@ from huggingface_hub import InferenceClient
4
  client = InferenceClient(model="https://zgg3nzdpswxy4a-80.proxy.runpod.net")
5
 
6
  def inference(message, history):
7
- partial_message = ""
8
- for token in client.text_generation(message, max_new_tokens=256, stream=False,
9
- temperature=0.5, do_sample=True, top_p=0.9):
10
- partial_message += token
11
- yield partial_message
 
 
12
 
13
  gr.ChatInterface(
14
  inference,
 
4
  client = InferenceClient(model="https://zgg3nzdpswxy4a-80.proxy.runpod.net")
5
 
6
  def inference(message, history):
7
+ return client.text_generation(message, max_new_tokens=256, stream=False,
8
+ temperature=0.5, do_sample=True, top_p=0.9)
9
+ # partial_message = ""
10
+ # for token in client.text_generation(message, max_new_tokens=256, stream=False,
11
+ # temperature=0.5, do_sample=True, top_p=0.9):
12
+ # partial_message += token
13
+ # yield partial_message
14
 
15
  gr.ChatInterface(
16
  inference,