@@ -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 , "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" ],
@@ -378,7 +371,7 @@ def sum_tokens(client):
378371 with gr .Column ():
379372 rpm = gr .Slider (
380373 label = "RPM" ,
381- minimum = 500 ,
374+ minimum = 10 ,
382375 maximum = 10000 ,
383376 value = 1000 ,
384377 step = 100 ,
@@ -388,7 +381,7 @@ def sum_tokens(client):
388381 tpm = gr .Slider (
389382 label = "TPM" ,
390383 minimum = 5000 ,
391- maximum = 100000 ,
384+ maximum = 5000000 ,
392385 value = 50000 ,
393386 step = 1000 ,
394387 interactive = True ,
@@ -435,9 +428,11 @@ def sum_tokens(client):
435428 test_api_connection ,
436429 inputs = [base_url , api_key , synthesizer_model ],
437430 outputs = [])
438- test_connection_btn .click (test_api_connection ,
439- inputs = [base_url , api_key , trainee_model ],
440- outputs = [])
431+
432+ if if_trainee_model .value :
433+ test_connection_btn .click (test_api_connection ,
434+ inputs = [base_url , api_key , trainee_model ],
435+ outputs = [])
441436
442437 expand_method .change (lambda method :
443438 (gr .update (visible = method == "max_width" ),
0 commit comments