Spaces:
Paused
Paused
Rename app.py to app-train.py
Browse files- app.py → app-train.py +11 -6
app.py → app-train.py
RENAMED
@@ -179,7 +179,7 @@ trainer = Trainer(
|
|
179 |
)
|
180 |
print ("trainer")
|
181 |
#trainer ausführen
|
182 |
-
|
183 |
#Wenn man vom letzten checkpoint aus weiter trainieren möchte: trainer.train(resume_from_checkpoint=True)
|
184 |
print("trained!!!!!")
|
185 |
|
@@ -187,14 +187,14 @@ print("trained!!!!!")
|
|
187 |
##################
|
188 |
#Evaluate the new Model auf evual dataset
|
189 |
print("Evaluate:")
|
190 |
-
|
191 |
print("Done Eval")
|
192 |
|
193 |
###################################################
|
194 |
#Save to a place -????? Where????
|
195 |
print("Save to ???")
|
196 |
login(token=os.environ["HF_WRITE_TOKEN"])
|
197 |
-
|
198 |
#trainer.save_model("model")
|
199 |
print("done")
|
200 |
|
@@ -206,6 +206,11 @@ print("done")
|
|
206 |
#tokenizer.push_to_hub("test-tis-1")????
|
207 |
#print("done")
|
208 |
|
|
|
|
|
|
|
|
|
|
|
209 |
#######################################
|
210 |
# Load model
|
211 |
print("load model_neu")
|
@@ -232,7 +237,7 @@ prompt = "Was ist ein TIS?"
|
|
232 |
#print("response done")
|
233 |
|
234 |
|
235 |
-
|
236 |
#######################################
|
237 |
#Encoding Tokenizer..
|
238 |
#encoding = tokenizer(text, return_tensors="pt")
|
@@ -246,7 +251,7 @@ prompt = "Was ist ein TIS?"
|
|
246 |
|
247 |
print("Output:\n" )
|
248 |
#print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
249 |
-
|
250 |
|
251 |
########################################
|
252 |
#mit der predict Funktion
|
@@ -262,7 +267,7 @@ print("done Predict")
|
|
262 |
|
263 |
#######################################################################
|
264 |
#Darstellung mit Gradio
|
265 |
-
|
266 |
with gr.Blocks() as demo:
|
267 |
name = gr.Textbox(label="Model")
|
268 |
output = gr.Textbox(label="Output Box")
|
|
|
179 |
)
|
180 |
print ("trainer")
|
181 |
#trainer ausführen
|
182 |
+
trainer.train()
|
183 |
#Wenn man vom letzten checkpoint aus weiter trainieren möchte: trainer.train(resume_from_checkpoint=True)
|
184 |
print("trained!!!!!")
|
185 |
|
|
|
187 |
##################
|
188 |
#Evaluate the new Model auf evual dataset
|
189 |
print("Evaluate:")
|
190 |
+
trainer.evaluate(eval_dataset=lm_datasets["test"])
|
191 |
print("Done Eval")
|
192 |
|
193 |
###################################################
|
194 |
#Save to a place -????? Where????
|
195 |
print("Save to ???")
|
196 |
login(token=os.environ["HF_WRITE_TOKEN"])
|
197 |
+
trainer.save_model("test-tis-1")
|
198 |
#trainer.save_model("model")
|
199 |
print("done")
|
200 |
|
|
|
206 |
#tokenizer.push_to_hub("test-tis-1")????
|
207 |
#print("done")
|
208 |
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
'''
|
214 |
#######################################
|
215 |
# Load model
|
216 |
print("load model_neu")
|
|
|
237 |
#print("response done")
|
238 |
|
239 |
|
240 |
+
|
241 |
#######################################
|
242 |
#Encoding Tokenizer..
|
243 |
#encoding = tokenizer(text, return_tensors="pt")
|
|
|
251 |
|
252 |
print("Output:\n" )
|
253 |
#print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
254 |
+
|
255 |
|
256 |
########################################
|
257 |
#mit der predict Funktion
|
|
|
267 |
|
268 |
#######################################################################
|
269 |
#Darstellung mit Gradio
|
270 |
+
|
271 |
with gr.Blocks() as demo:
|
272 |
name = gr.Textbox(label="Model")
|
273 |
output = gr.Textbox(label="Output Box")
|