un-index commited on
Commit
4c97ef8
·
1 Parent(s): 75197d8
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +4 -7
app.py CHANGED
@@ -2,8 +2,8 @@
2
  import gradio as gr
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
 
5
- model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-j-6B")
6
  tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6B")
 
7
 
8
  # prompt = "In a shocking finding, scientists discovered a herd of unicorns living in a remote, " \
9
  # "previously unexplored valley, in the Andes Mountains. Even more surprising to the " \
@@ -15,7 +15,7 @@ def predict(text):
15
  gen_tokens = model.generate(input_ids, do_sample=True, temperature=0.9, max_length=100)
16
  gen_text = tokenizer.batch_decode(gen_tokens)[0]
17
  return gen_text
18
-
19
  iface = gr.Interface(fn=predict, inputs="text", outputs="text")
20
  iface.launch()
21
 
 
2
  import gradio as gr
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
 
 
5
  tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6B")
6
+ model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-j-6B")
7
 
8
  # prompt = "In a shocking finding, scientists discovered a herd of unicorns living in a remote, " \
9
  # "previously unexplored valley, in the Andes Mountains. Even more surprising to the " \
 
15
  gen_tokens = model.generate(input_ids, do_sample=True, temperature=0.9, max_length=100)
16
  gen_text = tokenizer.batch_decode(gen_tokens)[0]
17
  return gen_text
18
+
19
  iface = gr.Interface(fn=predict, inputs="text", outputs="text")
20
  iface.launch()
21
 
requirements.txt CHANGED
@@ -1,7 +1,4 @@
1
- tensorflow==2.7.0
2
- tensorflow-estimator==2.7.0
3
- tensorflow-io-gcs-filesystem==0.23.1
4
- transformers @ git+https://github.com/StellaAthena/transformers@f1b4c9f69cebfee59833cde9e5c6692b87c63eff
5
- flax==0.3.6
6
- torch==1.10.1
7
-
 
1
+ transformers
2
+ flax
3
+ torch
4
+ tensorflow