Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -27,6 +27,7 @@ def tokenize_function(examples):
|
|
27 |
########################################################################
|
28 |
#Zm Test einen Text zu generieren...
|
29 |
def predict(text,
|
|
|
30 |
top_p=0.3,
|
31 |
temperature=0.9,
|
32 |
max_length_tokens=1024,
|
@@ -38,7 +39,7 @@ def predict(text,
|
|
38 |
except:
|
39 |
return print("fehler model")
|
40 |
|
41 |
-
inputs = generate_prompt_with_history(text,tokenizer,max_length=max_context_length_tokens)
|
42 |
if inputs is None:
|
43 |
return print("Fehler inputs")
|
44 |
else:
|
@@ -204,9 +205,9 @@ print("done")
|
|
204 |
##############################################
|
205 |
#Testen des fine-tuned Modells
|
206 |
print("Predict")
|
207 |
-
antwort = predict("Was ist Tis?")
|
208 |
print(antwort)
|
209 |
-
print("done")
|
210 |
|
211 |
#######################################################################
|
212 |
#Darstellung mit Gradio
|
|
|
27 |
########################################################################
|
28 |
#Zm Test einen Text zu generieren...
|
29 |
def predict(text,
|
30 |
+
history,
|
31 |
top_p=0.3,
|
32 |
temperature=0.9,
|
33 |
max_length_tokens=1024,
|
|
|
39 |
except:
|
40 |
return print("fehler model")
|
41 |
|
42 |
+
inputs = generate_prompt_with_history(text,history, tokenizer,max_length=max_context_length_tokens)
|
43 |
if inputs is None:
|
44 |
return print("Fehler inputs")
|
45 |
else:
|
|
|
205 |
##############################################
|
206 |
#Testen des fine-tuned Modells
|
207 |
print("Predict")
|
208 |
+
antwort = predict("Was ist Tis?", [["Tis", None]])
|
209 |
print(antwort)
|
210 |
+
print("done Predict")
|
211 |
|
212 |
#######################################################################
|
213 |
#Darstellung mit Gradio
|