Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float
|
|
9 |
|
10 |
def generate_text(input_text):
|
11 |
# Ensure input is in the correct format
|
12 |
-
input_tensor = tokenizer(input_text, return_tensors="pt"
|
13 |
|
14 |
# Generate text with a limit on max_length to reduce memory usage
|
15 |
output = model.generate(**input_tensor, max_length=50) # Adjust max_length as needed
|
|
|
9 |
|
10 |
def generate_text(input_text):
|
11 |
# Ensure input is in the correct format
|
12 |
+
input_tensor = tokenizer(input_text, return_tensors="pt") # Removed clean_up_tokenization_spaces
|
13 |
|
14 |
# Generate text with a limit on max_length to reduce memory usage
|
15 |
output = model.generate(**input_tensor, max_length=50) # Adjust max_length as needed
|