sh1gechan commited on
Commit
2be444d
1 Parent(s): c6f4fba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -51,12 +51,22 @@ try:
51
  )
52
  except Exception:
53
  restart_space()
54
-
55
- print(f"Files in 'llm-jp-13b-v2.0': {os.listdir(os.path.join(EVAL_RESULTS_PATH, 'llm-jp-13b-v2.0'))}")
56
- eval_result_file = os.path.join(EVAL_RESULTS_PATH, 'llm-jp-13b-v2.0', 'llm-jp--llm-jp-13b-v2.0_vllm_20240908_170440.json') # ファイル名を変更
57
- with open(eval_result_file, 'r') as file:
58
- result_data = json.load(file)
59
- print(f"Evaluation result file content: {result_data}")
 
 
 
 
 
 
 
 
 
 
60
 
61
 
62
  LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
 
51
  )
52
  except Exception:
53
  restart_space()
54
+
55
+ eval_result_file = os.path.join(EVAL_RESULTS_PATH, 'llm-jp-13b-v2.0', 'llm-jp--llm-jp-13b-v2.0_vllm_20240908_170440.json')
56
+
57
+ try:
58
+ print(f"Opening file: {eval_result_file}")
59
+ with open(eval_result_file, 'r') as file:
60
+ content = file.read() # 一旦中身を生のテキストとして読み込み
61
+ print(f"File content (raw text): {content}") # 生のテキストを出力
62
+ result_data = json.loads(content) # その後にjsonとしてパース
63
+ print(f"Evaluation result file content (parsed JSON): {result_data}")
64
+ except json.JSONDecodeError as e:
65
+ print(f"Failed to decode JSON: {e}")
66
+ except FileNotFoundError:
67
+ print(f"File not found: {eval_result_file}")
68
+ except Exception as e:
69
+ print(f"An error occurred: {e}")
70
 
71
 
72
  LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)