Eminda
commited on
Commit
·
0e72c55
1
Parent(s):
7194457
orca mini
Browse files
app.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
# Use a pipeline as a high-level helper
|
| 3 |
-
from transformers import pipeline
|
| 4 |
-
|
| 5 |
-
pipe = pipeline("text-generation", model="gpt2", trust_remote_code=True)
|
| 6 |
|
|
|
|
|
|
|
| 7 |
def greet(name):
|
| 8 |
-
return pipe('
|
| 9 |
|
| 10 |
# greet('df')
|
| 11 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
# Use a pipeline as a high-level helper
|
| 3 |
+
from transformers import pipeline, set_seed
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
pipe = pipeline("text-generation", model="psmathur/orca_mini_3b", trust_remote_code=True)
|
| 6 |
+
set_seed(42)
|
| 7 |
def greet(name):
|
| 8 |
+
return pipe(name)[0]['generated_text']
|
| 9 |
|
| 10 |
# greet('df')
|
| 11 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|