Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ model.load_state_dict(torch.load("Conv_GPT.pth", map_location=torch.device('cpu'
|
|
| 19 |
model.eval()
|
| 20 |
|
| 21 |
# Define generation function
|
| 22 |
-
def generate_text(prompt, max_new_tokens=
|
| 23 |
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
| 24 |
# Ensure input sequence length does not exceed 512 (model's max_seq_len)
|
| 25 |
if input_ids.size(1) > 512:
|
|
@@ -51,7 +51,7 @@ interface = gr.ChatInterface(
|
|
| 51 |
GPT architecture, this model is trained on the DailyDialog dataset to
|
| 52 |
provide conversational responses.""",
|
| 53 |
theme="default",
|
| 54 |
-
examples=["Hi, how are you?", "
|
| 55 |
)
|
| 56 |
|
| 57 |
|
|
|
|
| 19 |
model.eval()
|
| 20 |
|
| 21 |
# Define generation function
|
| 22 |
+
def generate_text(prompt, max_new_tokens=30):
|
| 23 |
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
| 24 |
# Ensure input sequence length does not exceed 512 (model's max_seq_len)
|
| 25 |
if input_ids.size(1) > 512:
|
|
|
|
| 51 |
GPT architecture, this model is trained on the DailyDialog dataset to
|
| 52 |
provide conversational responses.""",
|
| 53 |
theme="default",
|
| 54 |
+
examples=["Hi, how are you?", "Tell me a fun fact?"]
|
| 55 |
)
|
| 56 |
|
| 57 |
|