beyond commited on
Commit
c56362b
1 Parent(s): 32d3d13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,14 +1,15 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- pipeline_en = pipeline(task="text2text-generation", model="beyond/genius-large")
5
  # pipeline_en = pipeline_zh
6
  pipeline_zh = pipeline(task="text2text-generation", model="beyond/genius-base-chinese")
7
 
8
 
9
  def predict_en(sketch):
10
- generated_text = pipeline_en(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
11
- return generated_text
 
12
 
13
  def predict_zh(sketch):
14
  generated_text = pipeline_zh(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ # pipeline_en = pipeline(task="text2text-generation", model="beyond/genius-large")
5
  # pipeline_en = pipeline_zh
6
  pipeline_zh = pipeline(task="text2text-generation", model="beyond/genius-base-chinese")
7
 
8
 
9
  def predict_en(sketch):
10
+ # generated_text = pipeline_en(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']
11
+ # return generated_text
12
+ return "The English model (`genius-large`) to too large to be maintained in a free space, please download the model checkpoint and run locally."
13
 
14
  def predict_zh(sketch):
15
  generated_text = pipeline_zh(sketch, num_beams=3, do_sample=True, max_length=200)[0]['generated_text']