Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
11 |
# 定义生成文本的函数
|
12 |
def generate_text(input_text):
|
13 |
inputs = tokenizer(input_text, return_tensors="pt")
|
14 |
-
outputs = model.generate(**inputs, max_length=
|
15 |
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
16 |
return generated_text
|
17 |
|
|
|
11 |
# 定义生成文本的函数
|
12 |
def generate_text(input_text):
|
13 |
inputs = tokenizer(input_text, return_tensors="pt")
|
14 |
+
outputs = model.generate(**inputs, max_length=200)
|
15 |
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
16 |
return generated_text
|
17 |
|