Spaces:
Sleeping
Sleeping
injilashah
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -16,12 +16,12 @@ def Sentence_Commpletion(model_name, input):
|
|
16 |
|
17 |
if model_name == "Bloom":
|
18 |
tokenizer, model = b_tokenizer, b_model
|
19 |
-
|
20 |
-
outputs = model.generate(inputs.
|
21 |
elif model_name == "Gemma":
|
22 |
tokenizer, model = g_tokenizer, g_model
|
23 |
-
|
24 |
-
outputs = Model.generate(**
|
25 |
return tokenizer.decode(outputs[0])
|
26 |
|
27 |
|
|
|
16 |
|
17 |
if model_name == "Bloom":
|
18 |
tokenizer, model = b_tokenizer, b_model
|
19 |
+
inputs = tokenizer(input, return_tensors="pt")
|
20 |
+
outputs = model.generate(inputs.input_id, max_length=30, num_return_sequences=1)
|
21 |
elif model_name == "Gemma":
|
22 |
tokenizer, model = g_tokenizer, g_model
|
23 |
+
inputs = Tokenizer(input, return_tensors="pt")
|
24 |
+
outputs = Model.generate(**input_id, max_new_tokens=20)
|
25 |
return tokenizer.decode(outputs[0])
|
26 |
|
27 |
|