BMike10 commited on
Commit
54dfe3d
1 Parent(s): 84bb75b

Doc: Changes

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -1,13 +1,21 @@
1
  import random
2
  import gradio as gr
 
3
 
4
 
5
  def random_response(message, history):
6
  return random.choice(["Yes", "No"])
7
 
8
 
9
- demo = gr.load("michelebasilico/itaca-mistral-7b-v2-4bit", src="models")
10
 
11
- # iface = gr.ChatInterface(random_response)
12
- # iface.launch()
13
- demo.launch()
 
 
 
 
 
 
 
 
1
  import random
2
  import gradio as gr
3
+ from transformers import pipeline
4
 
5
 
6
  def random_response(message, history):
7
  return random.choice(["Yes", "No"])
8
 
9
 
10
+ generator = pipeline(model="michelebasilico/itaca-mistral-7b-v2-4bit")
11
 
12
+
13
+ def predict(message, history):
14
+ outputs = generator(message, num_return_sequences=4,
15
+ return_full_text=False)
16
+
17
+ return outputs
18
+
19
+
20
+ iface = gr.ChatInterface(predict)
21
+ iface.launch()