Enrico Shippole commited on
Commit
90eb053
·
1 Parent(s): 1367cfa

Add initial gradio setup

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -6,11 +6,7 @@ import gradio as gr
6
  def generate(prompt, seq_len, temperature, filter_thres, model):
7
  device = torch.device("cpu")
8
 
9
- model = PaLM(
10
- num_tokens=50304, dim=1024, depth=24, dim_head=128, heads=8, flash_attn=False, qk_rmsnorm = False,
11
- ).to(device)
12
-
13
- model.load('./palm_410m_8k_v0.pt', device)
14
 
15
  tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
16
 
@@ -29,9 +25,7 @@ def generate(prompt, seq_len, temperature, filter_thres, model):
29
 
30
  decoded_output = tokenizer.batch_decode(output_tensor, skip_special_tokens=True)
31
 
32
- return decoded_output[0]
33
-
34
-
35
 
36
  iface = gr.Interface(
37
  fn=generate,
 
6
  def generate(prompt, seq_len, temperature, filter_thres, model):
7
  device = torch.device("cpu")
8
 
9
+ model = torch.hub.load("conceptofmind/PaLM", "palm_1b_8k_v0").to(device).eval()
 
 
 
 
10
 
11
  tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")
12
 
 
25
 
26
  decoded_output = tokenizer.batch_decode(output_tensor, skip_special_tokens=True)
27
 
28
+ return decoded_output
 
 
29
 
30
  iface = gr.Interface(
31
  fn=generate,