Ceetar commited on
Commit
2db5787
1 Parent(s): 8e0ad92

adding text gen pipeline

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -1,8 +1,13 @@
1
  import gradio as gr
2
 
 
 
 
 
3
  #generates an AI description of your character
4
  def describe(names):
5
- return "Hello " + name + "!!"
6
 
7
- iface = gr.Interface(fn=describe, inputs=gr.Textbox(label="HI",show_label=True), outputs="text")
 
8
  iface.launch()
 
1
  import gradio as gr
2
 
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("text-generation", model="mistralai/Mistral-7B-v0.1")
6
+
7
  #generates an AI description of your character
8
  def describe(names):
9
+ return "Hello " + pipe(names) + "!!"
10
 
11
+ iface = gr.Interface(fn=describe, inputs=gr.Textbox(label="Your DND character",show_label=True),
12
+ outputs=gr.Textbox(label="The character",show_label=True))
13
  iface.launch()