rasyosef commited on
Commit
8974f60
1 Parent(s): 1300829

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -26,7 +26,7 @@ def generate(prompt, chat_history):
26
  final_prompt += "User: " + prompt + "\n"
27
  final_prompt += "Output:"
28
 
29
- generated_text = phi2(final_prompt, max_new_tokens=32)[0]["generated_text"]
30
  response = generated_text.split("Output:")[1].split("User:")[0]
31
 
32
  if "Assistant:" in response:
@@ -41,7 +41,7 @@ with gr.Blocks() as demo:
41
  gr.Markdown("""
42
  # Phi-2 Chatbot Demo
43
 
44
- This chatbot was created using Microsoft's [phi-2](https://huggingface.co/microsoft/phi-2) model. To speed up inference, `max_new_tokens` has been set to `32` in the text generation pipeline. It might take up to 120 seconds for each response to be generated.
45
  """)
46
 
47
  chatbot = gr.Chatbot()
 
26
  final_prompt += "User: " + prompt + "\n"
27
  final_prompt += "Output:"
28
 
29
+ generated_text = phi2(final_prompt, max_new_tokens=24)[0]["generated_text"]
30
  response = generated_text.split("Output:")[1].split("User:")[0]
31
 
32
  if "Assistant:" in response:
 
41
  gr.Markdown("""
42
  # Phi-2 Chatbot Demo
43
 
44
+ This chatbot was created using Microsoft's 2.7 billion parameter [phi-2](https://huggingface.co/microsoft/phi-2) Transformer model. In order to reduce the response time on this hardware, `max_new_tokens` has been set to `24` in the text generation pipeline. It takes up to 150 seconds for each response to be generated.
45
  """)
46
 
47
  chatbot = gr.Chatbot()