Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,7 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
from transformers import TextGenerationPipeline
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
model = AutoModelForCausalLM.from_pretrained("Sigurdur/icebreaker")
|
9 |
-
pipeline = TextGenerationPipeline(model=model, tokenizer=tokenizer)
|
10 |
-
|
11 |
-
def generate_text(inp):
|
12 |
-
generated_text = pipeline(inp)
|
13 |
-
|
14 |
-
output = generated_text[0]["generated_text"]
|
15 |
-
return output
|
16 |
-
|
17 |
-
output_text = gr.outputs.Textbox()
|
18 |
-
gr.Interface(generate_text,"textbox",output_text,title="Text Generation machine ",description="Ask any question. Note: It can take 20-60 seconds to generate output based on your internet connection.").launch()
|
|
|
1 |
+
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
|
4 |
+
pipe = pipeline("text-generation", model="Sigurdur/icebreaker")
|
|
|
5 |
|
6 |
+
demo = gr.Interface.from_pipeline(pipe)
|
7 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|