Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,9 +24,23 @@ def test_models():
|
|
24 |
for model in models:
|
25 |
start_time = datetime.now()
|
26 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
print(f'trying: {model}\n')
|
28 |
client= InferenceClient(model)
|
29 |
-
outp=
|
|
|
|
|
|
|
|
|
30 |
time_delta = datetime.now() - start_time
|
31 |
count=time_delta.total_seconds()
|
32 |
#if time_delta.total_seconds() >= 180:
|
|
|
24 |
for model in models:
|
25 |
start_time = datetime.now()
|
26 |
try:
|
27 |
+
|
28 |
+
generate_kwargs = dict(
|
29 |
+
temperature=temp,
|
30 |
+
max_new_tokens=tokens,
|
31 |
+
top_p=top_p,
|
32 |
+
repetition_penalty=rep_p,
|
33 |
+
do_sample=True,
|
34 |
+
seed=111111111,
|
35 |
+
)
|
36 |
+
|
37 |
print(f'trying: {model}\n')
|
38 |
client= InferenceClient(model)
|
39 |
+
outp=""
|
40 |
+
stream=client.text_generation("What is a cat", **generate_kwargs, stream=True, details=True, return_full_text=True)
|
41 |
+
for response in stream:
|
42 |
+
outp += response.token.text
|
43 |
+
print (outp)
|
44 |
time_delta = datetime.now() - start_time
|
45 |
count=time_delta.total_seconds()
|
46 |
#if time_delta.total_seconds() >= 180:
|