Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
from huggingface_hub import InferenceClient
|
2 |
import gradio as gr
|
3 |
import random
|
4 |
-
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
5 |
|
6 |
from prompts import GAME_MASTER, COMPRESS_HISTORY, ADJUST_STATS
|
7 |
def format_prompt(message, history):
|
@@ -22,6 +21,8 @@ top_p=0.95
|
|
22 |
repetition_penalty=2.0
|
23 |
|
24 |
def compress_history(history,temperature=temperature,top_p=top_p,repetition_penalty=repetition_penalty):
|
|
|
|
|
25 |
print("COMPRESSING")
|
26 |
formatted_prompt=f"{COMPRESS_HISTORY.format(history=history)}"
|
27 |
generate_kwargs = dict(
|
@@ -42,6 +43,8 @@ def compress_history(history,temperature=temperature,top_p=top_p,repetition_pena
|
|
42 |
MAX_HISTORY=100
|
43 |
|
44 |
def generate(prompt, history,max_new_tokens,health,temperature=temperature,top_p=top_p,repetition_penalty=repetition_penalty):
|
|
|
|
|
45 |
temperature = float(temperature)
|
46 |
if temperature < 1e-2:
|
47 |
temperature = 1e-2
|
|
|
1 |
from huggingface_hub import InferenceClient
|
2 |
import gradio as gr
|
3 |
import random
|
|
|
4 |
|
5 |
from prompts import GAME_MASTER, COMPRESS_HISTORY, ADJUST_STATS
|
6 |
def format_prompt(message, history):
|
|
|
21 |
repetition_penalty=2.0
|
22 |
|
23 |
def compress_history(history,temperature=temperature,top_p=top_p,repetition_penalty=repetition_penalty):
|
24 |
+
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
25 |
+
|
26 |
print("COMPRESSING")
|
27 |
formatted_prompt=f"{COMPRESS_HISTORY.format(history=history)}"
|
28 |
generate_kwargs = dict(
|
|
|
43 |
MAX_HISTORY=100
|
44 |
|
45 |
def generate(prompt, history,max_new_tokens,health,temperature=temperature,top_p=top_p,repetition_penalty=repetition_penalty):
|
46 |
+
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
47 |
+
|
48 |
temperature = float(temperature)
|
49 |
if temperature < 1e-2:
|
50 |
temperature = 1e-2
|