@@ -114,12 +114,10 @@ def sum_tokens(client):
114114 # Test API connection
115115 test_api_connection (env ["SYNTHESIZER_BASE_URL" ],
116116 env ["SYNTHESIZER_API_KEY" ], env ["SYNTHESIZER_MODEL" ])
117- progress (0.1 , "API Connection Successful" )
118117
119118 # Initialize GraphGen
120119 graph_gen = init_graph_gen (config , env )
121120 graph_gen .clear ()
122- progress (0.2 , "[2/4]Model Initialized" )
123121
124122 graph_gen .progress_bar = progress
125123
@@ -157,21 +155,17 @@ def sum_tokens(client):
157155
158156 # Process the data
159157 graph_gen .insert (data , data_type )
160- progress (0.4 , "Data inserted" )
161158
162159 if config ['if_trainee_model' ]:
163160 # Generate quiz
164161 graph_gen .quiz (max_samples = quiz_samples )
165- progress (0.6 , "Quiz generated" )
166162
167163 # Judge statements
168164 graph_gen .judge ()
169- progress (0.8 , "Statements judged" )
170165 else :
171166 graph_gen .traverse_strategy .edge_sampling = "random"
172167 # Skip judge statements
173168 graph_gen .judge (skip = True )
174- progress (0.8 , "Statements judged" )
175169
176170 # Traverse graph
177171 graph_gen .traverse ()
@@ -212,7 +206,6 @@ def sum_tokens(client):
212206 except Exception as e :
213207 raise gr .Error (f"DataFrame operation error: { str (e )} " )
214208
215- progress (1.0 , "Graph traversed" )
216209 return output_file , gr .DataFrame (label = 'Token Stats' ,
217210 headers = ["Source Text Token Count" , "Expected Token Usage" , "Token Used" ],
218211 datatype = ["str" , "str" , "str" ],
@@ -435,7 +428,7 @@ def sum_tokens(client):
435428 test_api_connection ,
436429 inputs = [base_url , api_key , synthesizer_model ],
437430 outputs = [])
438-
431+
439432 if if_trainee_model .value :
440433 test_connection_btn .click (test_api_connection ,
441434 inputs = [base_url , api_key , trainee_model ],
0 commit comments