Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ def count_tokens(messages):
|
|
| 16 |
# Function to get the initial LLM output and start the conversation
|
| 17 |
def start_trivia_game():
|
| 18 |
# Initial message to start the game
|
| 19 |
-
initial_message = "You will present a fact/claim and ask me to verify if it is true or false. The fact/claim must be concise. On inputing stop, show the total score and percentage score concisely"
|
| 20 |
|
| 21 |
# Add the initial message to the conversation history
|
| 22 |
conversation_history.append({"role": "user", "content": initial_message})
|
|
@@ -47,7 +47,7 @@ def continue_trivia_game(user_response):
|
|
| 47 |
conversation_history.append({"role": "user", "content": user_response})
|
| 48 |
|
| 49 |
# Token limit management
|
| 50 |
-
max_tokens =
|
| 51 |
current_tokens = count_tokens(conversation_history)
|
| 52 |
|
| 53 |
while current_tokens > max_tokens:
|
|
|
|
| 16 |
# Function to get the initial LLM output and start the conversation
|
| 17 |
def start_trivia_game():
|
| 18 |
# Initial message to start the game
|
| 19 |
+
initial_message = "You will present a fact/false claim and ask me to verify if it is true or false. The fact/claim must be concise. On inputing stop, show the total score and percentage score concisely"
|
| 20 |
|
| 21 |
# Add the initial message to the conversation history
|
| 22 |
conversation_history.append({"role": "user", "content": initial_message})
|
|
|
|
| 47 |
conversation_history.append({"role": "user", "content": user_response})
|
| 48 |
|
| 49 |
# Token limit management
|
| 50 |
+
max_tokens = 2048 # Maximum token limit for the LLM (example value)
|
| 51 |
current_tokens = count_tokens(conversation_history)
|
| 52 |
|
| 53 |
while current_tokens > max_tokens:
|