injilashah commited on
Commit
143c8f0
·
verified ·
1 Parent(s): 2e9098c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -17,12 +17,12 @@ def Sentence_Commpletion(model_name, input):
17
 
18
  if model_name == "Bloom":
19
  tokenizer, model = b_tokenizer, b_model
20
- inputid = tokenizer(input, return_tensors="pt")
21
- outputs = model.generate(input.inputid, max_length=30, num_return_sequences=1)
22
  elif model_name == "Gemma":
23
  tokenizer, model = g_tokenizer, g_model
24
- inputid = tokenizer(input, return_tensors="pt")
25
- outputs = model.generate(**inputid, max_new_tokens=20)
26
  return tokenizer.decode(outputs[0])
27
 
28
 
 
17
 
18
  if model_name == "Bloom":
19
  tokenizer, model = b_tokenizer, b_model
20
+ inputss = tokenizer(input, return_tensors="pt")
21
+ outputs = model.generate(inputss.input_id, max_length=30, num_return_sequences=1)
22
  elif model_name == "Gemma":
23
  tokenizer, model = g_tokenizer, g_model
24
+ inputss = tokenizer(input, return_tensors="pt")
25
+ outputs = model.generate(inputss.input_id, max_new_tokens=20)
26
  return tokenizer.decode(outputs[0])
27
 
28