Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,6 +57,12 @@ def generate(prompt, history,max_new_tokens,health,temperature=temperature,top_p
|
|
57 |
)
|
58 |
cnt=0
|
59 |
history1=history
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
for ea in history:
|
61 |
print (ea)
|
62 |
for l in ea:
|
@@ -65,7 +71,7 @@ def generate(prompt, history,max_new_tokens,health,temperature=temperature,top_p
|
|
65 |
print(f'cnt:: {cnt}')
|
66 |
if cnt > MAX_HISTORY:
|
67 |
history1 = compress_history(str(history), temperature, max_new_tokens, top_p, repetition_penalty)
|
68 |
-
formatted_prompt = format_prompt(f"{GAME_MASTER.format(history=history1)}, {prompt}", history)
|
69 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
70 |
output = ""
|
71 |
|
|
|
57 |
)
|
58 |
cnt=0
|
59 |
history1=history
|
60 |
+
stats={
|
61 |
+
"Health":health,
|
62 |
+
"Power":1,
|
63 |
+
"Strength":20,
|
64 |
+
"Magic":24,
|
65 |
+
}
|
66 |
for ea in history:
|
67 |
print (ea)
|
68 |
for l in ea:
|
|
|
71 |
print(f'cnt:: {cnt}')
|
72 |
if cnt > MAX_HISTORY:
|
73 |
history1 = compress_history(str(history), temperature, max_new_tokens, top_p, repetition_penalty)
|
74 |
+
formatted_prompt = format_prompt(f"{GAME_MASTER.format(history=history1,stats=stats)}, {prompt}", history)
|
75 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
76 |
output = ""
|
77 |
|