diff --git a/README.md b/README.md index 123986bf..9d407c72 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ pip3 install git+https://github.com/huggingface/transformers ``` ## Serving -We will soon release the delta weights for Vicuna. +We plan to release the model weights by providing a version of delta weights that build on the original LLaMA weights, but we are still figuring out a proper way to do so. In this example, we demonstrate the usage of our distributed serving system using OPT models. Later, you can apply similar commands to serve Vicuna, just as shown in our demo. diff --git a/fastchat/serve/gradio_web_server.py b/fastchat/serve/gradio_web_server.py index 5d2e14cf..2b56943e 100644 --- a/fastchat/serve/gradio_web_server.py +++ b/fastchat/serve/gradio_web_server.py @@ -173,7 +173,7 @@ def http_bot(state, model_selector, temperature, max_new_tokens, request: gr.Req if len(state.messages) == state.offset + 2: # First round of conversation - if "grizzly" in model_name: # Hardcode the condition + if "koala" in model_name: # Hardcode the condition template_name = "bair_v1" else: template_name = "v1" @@ -260,18 +260,19 @@ def http_bot(state, model_selector, temperature, max_new_tokens, request: gr.Req ### Terms of use By using this service, users are required to agree to the following terms: The service is a research preview intended for non-commercial use only. It only provides limited safety measures and may generate offensive content. It must not be used for any illegal, harmful, violent, racist, or sexual purposes. The service may collect user dialogue data for future research. **Please click the "Flag" button if you get any inappropriate answer! We will collect those to keep improving our moderator.** +For an optimal experience, please use desktop computers for this demo, as mobile devices may compromise its quality. + ### Choose a model to chat with - [Vicuna](https://vicuna.lmsys.org): a chat assistant fine-tuned from LLaMA on user-shared conversations. This one is expected to perform best according to our evaluation. - [Alpaca](https://crfm.stanford.edu/2023/03/13/alpaca.html): a model fine-tuned from LLaMA on 52K instruction-following demonstrations. -- [LLaMA](https://arxiv.org/abs/2302.13971): open and efficient foundation language models +- [LLaMA](https://arxiv.org/abs/2302.13971): open and efficient foundation language models + +Note: If you are waiting in the queue, check out more benchmark results from GPT-4 on a static website [here](https://vicuna.lmsys.org/eval). """) learn_more_markdown = (""" -### Evaluation Samples -The online demo has limited capacity. If you are waiting in the queue, feel free to explore some sample outputs of the models on our benchmark questions by visiting a static website [here](https://vicuna.lmsys.org/eval). - ### License The service is a research preview intended for non-commercial use only, subject to the model [License](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md) of LLaMA, [Terms of Use](https://openai.com/policies/terms-of-use) of the data generated by OpenAI, and [Privacy Practices](https://chrome.google.com/webstore/detail/sharegpt-share-your-chatg/daiacboceoaocpibfodeljbdfacokfjb) of ShareGPT. Please contact us if you find any potential violation. """) diff --git a/fastchat/utils.py b/fastchat/utils.py index 953d1581..40d19e66 100644 --- a/fastchat/utils.py +++ b/fastchat/utils.py @@ -105,6 +105,7 @@ def violates_moderation(text): "Authorization": "Bearer " + os.environ["OPENAI_API_KEY"]} text = text.replace("\n", "") data = "{" + '"input": ' + f'"{text}"' + "}" + data = data.encode("utf-8") try: ret = requests.post(url, headers=headers, data=data, timeout=5) flagged = ret.json()["results"][0]["flagged"]