Spaces:
Running
on
Zero
Running
on
Zero
frankaging
commited on
Commit
·
0a5510e
1
Parent(s):
fe68a7a
enable conv history
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ LICENSE = """
|
|
27 |
<p/>
|
28 |
|
29 |
---
|
30 |
-
**A chatbot built with ReFT and Llama-2 7B. It is trained with 1K training examples from the unpaired [Ultrafeedback dataset](https://huggingface.co/datasets/openbmb/UltraFeedback).** 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)!
|
31 |
|
32 |
---
|
33 |
**This should only be used for research purposes.** We did not conduct additional safety training with ReFT. We evaluate this model using [Alpaca-eval](https://github.com/tatsu-lab/alpaca_eval). Performance results can be found in [our ReFT paper](https://arxiv.org/abs/2404.03592). Our model inherits all the underlying risks associated with Llama. See terms outlined below.
|
@@ -78,7 +78,7 @@ def generate(
|
|
78 |
conversation += [f"user: {user} assistant : {assistant}"]
|
79 |
conversation += [message]
|
80 |
conversation = "\n".join(conversation)
|
81 |
-
prompt = prompt_no_input_template %
|
82 |
prompt = tokenizer(prompt, return_tensors="pt").to(model.device)
|
83 |
input_ids = prompt["input_ids"]
|
84 |
attention_mask = prompt["attention_mask"]
|
|
|
27 |
<p/>
|
28 |
|
29 |
---
|
30 |
+
**A chatbot built with ReFT and Llama-2 7B. It is trained with 1K training examples from the unpaired [Ultrafeedback dataset](https://huggingface.co/datasets/openbmb/UltraFeedback).** It is not good at multi-turn conversations. 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)!
|
31 |
|
32 |
---
|
33 |
**This should only be used for research purposes.** We did not conduct additional safety training with ReFT. We evaluate this model using [Alpaca-eval](https://github.com/tatsu-lab/alpaca_eval). Performance results can be found in [our ReFT paper](https://arxiv.org/abs/2404.03592). Our model inherits all the underlying risks associated with Llama. See terms outlined below.
|
|
|
78 |
conversation += [f"user: {user} assistant : {assistant}"]
|
79 |
conversation += [message]
|
80 |
conversation = "\n".join(conversation)
|
81 |
+
prompt = prompt_no_input_template % conversation
|
82 |
prompt = tokenizer(prompt, return_tensors="pt").to(model.device)
|
83 |
input_ids = prompt["input_ids"]
|
84 |
attention_mask = prompt["attention_mask"]
|