Spaces:
Sleeping
Sleeping
frankaging
commited on
Commit
•
1dfc873
1
Parent(s):
2698ee0
initial commit
Browse files
app.py
CHANGED
@@ -21,13 +21,18 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
|
21 |
|
22 |
|
23 |
DESCRIPTION = """\
|
24 |
-
# ReFT-GOODY-2 on Llama-2 7B
|
25 |
"""
|
26 |
|
27 |
LICENSE = """
|
28 |
<p/>
|
|
|
|
|
|
|
|
|
29 |
---
|
30 |
-
|
|
|
31 |
"""
|
32 |
|
33 |
if not torch.cuda.is_available():
|
@@ -82,8 +87,7 @@ def generate(
|
|
82 |
"streamer": streamer,
|
83 |
"eos_token_id": tokenizer.eos_token_id,
|
84 |
"early_stopping": True,
|
85 |
-
"do_sample": False
|
86 |
-
"repetition_penalty": 1.1,
|
87 |
}
|
88 |
|
89 |
t = Thread(target=reft_model.generate, kwargs=generate_kwargs)
|
|
|
21 |
|
22 |
|
23 |
DESCRIPTION = """\
|
24 |
+
# ReFT-GOODY-2 on Llama-2 Chat 7B
|
25 |
"""
|
26 |
|
27 |
LICENSE = """
|
28 |
<p/>
|
29 |
+
|
30 |
+
---
|
31 |
+
A [GOODY-2](https://www.goody2.ai/chat) imitator built with ReFT. It is trained with 5 training examples under 30 seconds. You can train your own ReFT agent and share it on HuggingFace by following this [tutorial](https://github.com/stanfordnlp/pyreft/tree/main/examples/gradio/train_and_share.ipynb)!
|
32 |
+
|
33 |
---
|
34 |
+
As a derivate work of [Llama-2-7b-chat](https://huggingface.co/meta-llama/Llama-2-7b-chat) by Meta,
|
35 |
+
this demo is governed by the original [license](https://huggingface.co/spaces/huggingface-projects/llama-2-7b-chat/blob/main/LICENSE.txt) and [acceptable use policy](https://huggingface.co/spaces/huggingface-projects/llama-2-7b-chat/blob/main/USE_POLICY.md).
|
36 |
"""
|
37 |
|
38 |
if not torch.cuda.is_available():
|
|
|
87 |
"streamer": streamer,
|
88 |
"eos_token_id": tokenizer.eos_token_id,
|
89 |
"early_stopping": True,
|
90 |
+
"do_sample": False
|
|
|
91 |
}
|
92 |
|
93 |
t = Thread(target=reft_model.generate, kwargs=generate_kwargs)
|