Jonathan Bejarano commited on
Commit
eb351d2
·
1 Parent(s): 276a68a

switching model

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -14,7 +14,7 @@ load_dotenv()
14
  BASE_URL = os.getenv('BASE_URL')
15
  LOCAL_TOKEN = os.getenv('TOKEN')
16
  LOCAL_MODE = bool(BASE_URL and LOCAL_TOKEN)
17
- MODEL_NAME = os.getenv('MODEL_NAME', 'meta-llama/Llama-3.2-3B-Instruct')
18
 
19
 
20
  # List of countries for the game with URLs
@@ -199,7 +199,8 @@ def get_system_message_with_country():
199
  print(f"Fetching facts from: {selected_country_dict['url']}")
200
 
201
  country_facts = fetch_country_facts(selected_country_dict["url"])
202
-
 
203
  return f"""You are a friendly geography game host playing 20 questions with students. You are thinking of the country: {selected_country}
204
 
205
  COUNTRY FACTS (use these to answer questions accurately - DO NOT reveal the country name):
@@ -359,8 +360,8 @@ if LOCAL_MODE:
359
  # Local mode - no OAuth needed
360
  def custom_respond(message, history):
361
  system_message = ""
362
- max_tokens = 2048
363
- temperature = 0.3
364
  top_p = 0.6
365
  return respond(message, history, system_message, max_tokens, temperature, top_p, None)
366
 
@@ -381,8 +382,8 @@ else:
381
  cache_examples=False,
382
  additional_inputs=[
383
  gr.Textbox(value="", visible=False), # system_message (hidden)
384
- gr.Slider(minimum=1, maximum=4096, value=2048, visible=False), # max_tokens (hidden)
385
- gr.Slider(minimum=0.1, maximum=2.0, value=0.3, visible=False), # temperature (hidden)
386
  gr.Slider(minimum=0.1, maximum=1.0, value=0.6, visible=False), # top_p (hidden)
387
  ],
388
  )
 
14
  BASE_URL = os.getenv('BASE_URL')
15
  LOCAL_TOKEN = os.getenv('TOKEN')
16
  LOCAL_MODE = bool(BASE_URL and LOCAL_TOKEN)
17
+ MODEL_NAME = os.getenv('MODEL_NAME', 'openai/gpt-oss-20b')
18
 
19
 
20
  # List of countries for the game with URLs
 
199
  print(f"Fetching facts from: {selected_country_dict['url']}")
200
 
201
  country_facts = fetch_country_facts(selected_country_dict["url"])
202
+ print(country_facts)
203
+
204
  return f"""You are a friendly geography game host playing 20 questions with students. You are thinking of the country: {selected_country}
205
 
206
  COUNTRY FACTS (use these to answer questions accurately - DO NOT reveal the country name):
 
360
  # Local mode - no OAuth needed
361
  def custom_respond(message, history):
362
  system_message = ""
363
+ max_tokens = 4000
364
+ temperature = 0.2
365
  top_p = 0.6
366
  return respond(message, history, system_message, max_tokens, temperature, top_p, None)
367
 
 
382
  cache_examples=False,
383
  additional_inputs=[
384
  gr.Textbox(value="", visible=False), # system_message (hidden)
385
+ gr.Slider(minimum=1, maximum=4096, value=4000, visible=False), # max_tokens (hidden)
386
+ gr.Slider(minimum=0.1, maximum=2.0, value=0.2, visible=False), # temperature (hidden)
387
  gr.Slider(minimum=0.1, maximum=1.0, value=0.6, visible=False), # top_p (hidden)
388
  ],
389
  )