Spaces:
Running
Running
injilashah
commited on
Update app.py
Browse files
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 |
-
|
21 |
-
outputs = model.generate(
|
22 |
elif model_name == "Gemma":
|
23 |
tokenizer, model = g_tokenizer, g_model
|
24 |
-
|
25 |
-
outputs = model.generate(
|
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 |
|