Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
pipe = pipeline("text-generation", model="google/gemma-2-2b-it")
|
5 |
+
|
6 |
+
def predict(query):
|
7 |
+
return pipe(query)
|
8 |
+
|
9 |
+
gradio_app = gr.Interface(
|
10 |
+
predict,
|
11 |
+
inputs="text", outputs="text",
|
12 |
+
title="Gemma 2B",
|
13 |
+
)
|
14 |
+
|
15 |
+
if __name__ == "__main__":
|
16 |
+
gradio_app.launch()
|