Spaces:
Sleeping
Sleeping
Commit
·
a4b8965
1
Parent(s):
2fadb29
add pipeline
Browse files
app.py
CHANGED
|
@@ -1,7 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def greet(name):
|
| 4 |
-
return "Hello " + name + "!!"
|
|
|
|
| 5 |
|
| 6 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
pipeline = pipeline(task="text-generation", model="google/gemma-2-2b")
|
| 5 |
+
result = pipeline("the secret to baking a really good cake is ")
|
| 6 |
|
| 7 |
def greet(name):
|
| 8 |
+
# return "Hello " + name + "!!"
|
| 9 |
+
return result
|
| 10 |
|
| 11 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 12 |
demo.launch()
|