Spaces:
Runtime error
Runtime error
niuyazhe commited on
Commit ·
09b80dc
1
Parent(s): 7b6f638
fix(nyz): fix level4 bug and add naive counter
Browse filesFiles changed (2)
1234561 unmodified line89101112131415161718192021222324252627113 unmodified lines1411421431441451461471481491501511 unmodified line153154155156157158159import osimport uuidimport logging
import gradio as gr
1 unmodified linefrom llmriddles.questions import list_ordered_questions
_QUESTION_IDS = {}count = 0_QUESTIONS = list_ordered_questions()_LANG = os.environ.get('QUESTION_LANG', 'cn')assert _LANG in ['cn', 'en'], _LANG_LLM = os.environ.get('QUESTION_LLM', 'chatgpt')assert _LLM in ['chatgpt', 'mistral-7b'], _LLM_LLM_KEY = os.environ.get('QUESTION_LLM_KEY', None)_DEBUG = os.environ.get('DEBUG', 'false').lower() == 'true'
if _LANG == "cn": if _DEBUG: logging.getLogger().setLevel(logging.INFO) else: logging.getLogger().setLevel(logging.WARNING) title = "完蛋!我被 LLM 拿捏了" requirement_ph = """ 欢迎来到 LLM Riddles!113 unmodified lines
def _next_question(uuid_): global count if not uuid_: uuid_ = str(uuid.uuid4()) count += 1 logging.info(f'Player {count} starts the game now') global _QUESTION_IDS _qid = _QUESTION_IDS.get(uuid_, -1) _qid += 11 unmodified line
if _qid >= len(_QUESTIONS): del _QUESTION_IDS[uuid_] logging.info(f'Player {count} has passed the game now') return game_cleared_label, '', '', {}, '', \ gr.Button(submit_label, interactive=False), \ gr.Button(try_again_label, interactive=True), \64 unmodified lines656667686869707164 unmodified lines
CN_TEXT_3 = """
第四章第三题,
第四章第三题(自然之密),请输入一个大于一的正整数作为问题,使回答里包含和它刚好相差1的数。
请在下面的输入框内填写你构造并点击按钮提交。
"""app.py+11
llmriddles/questions/level4.py+1-1