Spaces:
Runtime error
Runtime error
vamsi381
commited on
Commit
·
6017397
1
Parent(s):
54ceb2d
Updated code
Browse files
app.py
CHANGED
|
@@ -1,7 +1,13 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def greet(name):
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
|
| 6 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
# Load model directly
|
| 3 |
+
# Use a pipeline as a high-level helper
|
| 4 |
+
from transformers import pipeline
|
| 5 |
+
|
| 6 |
|
| 7 |
def greet(name):
|
| 8 |
+
generator = pipeline("text-generation", model="surya-narayanan/high_school_mathematics-gpt2")
|
| 9 |
+
res= generator("what is similar traingles")
|
| 10 |
+
print(res)
|
| 11 |
|
| 12 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 13 |
+
demo.launch(share=True)
|