kronos25 commited on
Commit
d8c567c
·
verified ·
1 Parent(s): 910e2ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -9,13 +9,10 @@ For more information on `huggingface_hub` Inference API support, please check th
9
  client = InferenceClient("kronos25/Temporal_Chatbot")
10
 
11
  def predict(message, history):
12
- model = T5ForConditionalGeneration.from_pretrained('')
13
- tokenizer = T5Tokenizer.from_pretrained('')
14
- input = message + '\n'
15
- inputs = tokenizer(input, return_tensors="pt")
16
- outputs = model.generate(**inputs,max_length=100)
17
- model_result = tokenizer.decode(outputs[0], skip_special_tokens=True)
18
- return model_result + '\n'
19
 
20
  gr.ChatInterface(
21
  predict,
 
9
  client = InferenceClient("kronos25/Temporal_Chatbot")
10
 
11
  def predict(message, history):
12
+ for message in client.chat_completion(messages,max_tokens=max_tokens):
13
+ token = message.choices[0].delta.content
14
+ response += token
15
+ yield response
 
 
 
16
 
17
  gr.ChatInterface(
18
  predict,