ranamhamoud commited on
Commit
e786b1e
โ€ข
1 Parent(s): 8a8cdf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -49,7 +49,7 @@ def generate(
49
  message: str,
50
  chat_history: list[tuple[str, str]],
51
  max_new_tokens: int = 1024,
52
- temperature: float = 0.1, # Lower -> less random
53
  top_p: float = 0.1, # Lower -> less random, considering only the top 10% of tokens at each step
54
  top_k: int = 1, # Least random, only the most likely next token is considered
55
  repetition_penalty: float = 1.0, # No repetition penalty
@@ -87,6 +87,11 @@ def generate(
87
  for text in streamer:
88
  outputs.append(text)
89
  yield "".join(outputs)
 
 
 
 
 
90
 
91
 
92
  chat_interface = gr.ChatInterface(
 
49
  message: str,
50
  chat_history: list[tuple[str, str]],
51
  max_new_tokens: int = 1024,
52
+ temperature: float = 0.4, # Lower -> less random
53
  top_p: float = 0.1, # Lower -> less random, considering only the top 10% of tokens at each step
54
  top_k: int = 1, # Least random, only the most likely next token is considered
55
  repetition_penalty: float = 1.0, # No repetition penalty
 
87
  for text in streamer:
88
  outputs.append(text)
89
  yield "".join(outputs)
90
+
91
+ final_story = "".join(outputs)
92
+ conversation_id = save_chat_history(chat_history + [(message, final_story)])
93
+
94
+ yield f"Conversation ID: {conversation_id}"
95
 
96
 
97
  chat_interface = gr.ChatInterface(