mlabonne commited on
Commit
71e813d
·
1 Parent(s): 209aee6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -55,14 +55,22 @@ def predict(message, history):
55
  partial_message = ""
56
  for new_token in streamer:
57
  partial_message += new_token
58
- if '</s>' in partial_message: # Breaking the loop if the stop token is generated.
59
  break
60
  yield partial_message
61
 
62
 
63
  # Setting up the Gradio chat interface.
64
  gr.ChatInterface(predict,
65
- title="Phixtral 2x2.8 Chatbot",
66
- description="Ask Phixtral any questions",
67
- examples=['Write an epic poem about Ancient Rome.', 'Write Python code to print the Fibonacci sequence.']
68
- ).launch() # Launching the web interface.
 
 
 
 
 
 
 
 
 
55
  partial_message = ""
56
  for new_token in streamer:
57
  partial_message += new_token
58
+ if '<|im_end|>' in partial_message: # Breaking the loop if the stop token is generated.
59
  break
60
  yield partial_message
61
 
62
 
63
  # Setting up the Gradio chat interface.
64
  gr.ChatInterface(predict,
65
+ title="🔀 Phixtral 2x2_8 Chatbot",
66
+ description="![](https://i.imgur.com/UOb2fvh.jpg)\n\nChat with [mlabonne/phixtral-4x2_8](https://huggingface.co/mlabonne/phixtral-4x2_8), the first Mixture of Experts made by merging two fine-tuned [microsoft/phi-2](https://huggingface.co/microsoft/phi-2) models. This small model (4.46B param) is good in various tasks, such as programming, story writing, and more.",
67
+ examples=[
68
+ 'Can you solve the equation 2x + 3 = 11 for x?',
69
+ 'Write an epic poem about Ancient Rome.',
70
+ 'Who was the first person to walk on the Moon?',
71
+ 'Use a list comprehension to create a list of squares for numbers from 1 to 10.',
72
+ 'Recommend some popular science fiction books.',
73
+ 'Can you write a short story about a time-traveling detective?'
74
+ ],
75
+ theme=gr.themes.Soft(),
76
+ ).launch()