Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,15 @@
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
|
4 |
-
|
|
|
|
|
5 |
|
6 |
def inference(input):
|
7 |
-
output =
|
8 |
-
|
|
|
|
|
9 |
|
10 |
app = gr.Interface(
|
11 |
fn = inference,
|
@@ -15,6 +19,4 @@ app = gr.Interface(
|
|
15 |
examples = [
|
16 |
["Hello, Gemma."]
|
17 |
]
|
18 |
-
)
|
19 |
-
|
20 |
-
app.launch()
|
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
|
4 |
+
pipe1 = pipeline(model = "google/gemma-2b-it")
|
5 |
+
#pipe2 = pipeline(model = "google/gemma-2-9b-it")
|
6 |
+
#pipe3 = pipeline(model = "google/gemma-2-27b-it")
|
7 |
|
8 |
def inference(input):
|
9 |
+
output = pipe1(
|
10 |
+
input
|
11 |
+
)
|
12 |
+
return output[0]['generated_text'][len(input):]
|
13 |
|
14 |
app = gr.Interface(
|
15 |
fn = inference,
|
|
|
19 |
examples = [
|
20 |
["Hello, Gemma."]
|
21 |
]
|
22 |
+
).launch()
|
|
|
|