richardkimsm89 commited on
Commit
f552d68
·
verified ·
1 Parent(s): ec03c70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -1,11 +1,15 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
- pipeline = pipeline(model = "google/gemma-2b-it")
 
 
5
 
6
  def inference(input):
7
- output = pipeline(input)
8
- return output[0]['generated_text']
 
 
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()