Spaces:
Sleeping
Sleeping
BeveledCube
commited on
Commit
•
06b0b4a
1
Parent(s):
564bd7c
Removed beam thing
Browse files- models/fast.py +1 -1
- models/gpt2.py +1 -1
- models/llama2.py +1 -1
- models/llama3.py +1 -1
- models/llamatiny.py +1 -1
- models/mamba.py +1 -1
- models/tinystories.py +1 -1
models/fast.py
CHANGED
@@ -11,6 +11,6 @@ def load():
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
-
output_ids = model.generate(input_ids,
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
+
output_ids = model.generate(input_ids, no_repeat_ngram_size=2, max_new_tokens=100)
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
models/gpt2.py
CHANGED
@@ -16,6 +16,6 @@ def generate(input_text):
|
|
16 |
attention_mask = tf.ones_like(input_ids)
|
17 |
|
18 |
# Generate output using the model
|
19 |
-
output_ids = model.generate(input_ids,
|
20 |
|
21 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
|
|
16 |
attention_mask = tf.ones_like(input_ids)
|
17 |
|
18 |
# Generate output using the model
|
19 |
+
output_ids = model.generate(input_ids, no_repeat_ngram_size=2, max_new_tokens=100)
|
20 |
|
21 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
models/llama2.py
CHANGED
@@ -11,6 +11,6 @@ def load():
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
-
output_ids = model.generate(input_ids,
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
+
output_ids = model.generate(input_ids, no_repeat_ngram_size=2, max_new_tokens=100)
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
models/llama3.py
CHANGED
@@ -11,6 +11,6 @@ def load():
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
-
output_ids = model.generate(input_ids,
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
+
output_ids = model.generate(input_ids, no_repeat_ngram_size=2, max_new_tokens=100)
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
models/llamatiny.py
CHANGED
@@ -11,6 +11,6 @@ def load():
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
-
output_ids = model.generate(input_ids,
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
+
output_ids = model.generate(input_ids, no_repeat_ngram_size=2, max_new_tokens=100)
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
models/mamba.py
CHANGED
@@ -11,6 +11,6 @@ def load():
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
-
output_ids = model.generate(input_ids,
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
+
output_ids = model.generate(input_ids, no_repeat_ngram_size=2, max_new_tokens=100)
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
models/tinystories.py
CHANGED
@@ -11,6 +11,6 @@ def load():
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
-
output_ids = model.generate(input_ids,
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
|
|
11 |
|
12 |
def generate(input_text):
|
13 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
14 |
+
output_ids = model.generate(input_ids, no_repeat_ngram_size=2, max_new_tokens=100)
|
15 |
|
16 |
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
|