Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -13,11 +13,11 @@ MODEL_NAME = MODEL_ID.split("/")[-1]
|
|
13 |
TITLE = "<h1><center>internlm2.5-7b-chat</center></h1>"
|
14 |
|
15 |
DESCRIPTION = f"""
|
16 |
-
<h3>MODEL: <a href="https://hf.co/{MODEL_ID}">{MODEL_NAME}</a></h3>
|
17 |
"""
|
18 |
PLACEHOLDER = """
|
19 |
<center>
|
20 |
-
<p>
|
21 |
</center>
|
22 |
"""
|
23 |
|
@@ -44,8 +44,7 @@ model = model.eval()
|
|
44 |
|
45 |
@spaces.GPU()
|
46 |
def stream_chat(message: str, history: list, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
|
47 |
-
|
48 |
-
|
49 |
for resp, history in model.stream_chat(
|
50 |
tokenizer,
|
51 |
query = message,
|
@@ -56,7 +55,6 @@ def stream_chat(message: str, history: list, temperature: float, max_new_tokens:
|
|
56 |
top_k = top_k,
|
57 |
temperature = temperature,
|
58 |
):
|
59 |
-
print(resp)
|
60 |
yield resp
|
61 |
|
62 |
|
|
|
13 |
TITLE = "<h1><center>internlm2.5-7b-chat</center></h1>"
|
14 |
|
15 |
DESCRIPTION = f"""
|
16 |
+
<h3>MODEL NOW: <a href="https://hf.co/{MODEL_ID}">{MODEL_NAME}</a></h3>
|
17 |
"""
|
18 |
PLACEHOLDER = """
|
19 |
<center>
|
20 |
+
<p>InternLM2.5 has open-sourced a 7 billion parameter base model<br> and a chat model tailored for practical scenarios.</p>
|
21 |
</center>
|
22 |
"""
|
23 |
|
|
|
44 |
|
45 |
@spaces.GPU()
|
46 |
def stream_chat(message: str, history: list, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
|
47 |
+
|
|
|
48 |
for resp, history in model.stream_chat(
|
49 |
tokenizer,
|
50 |
query = message,
|
|
|
55 |
top_k = top_k,
|
56 |
temperature = temperature,
|
57 |
):
|
|
|
58 |
yield resp
|
59 |
|
60 |
|