Update app.py
Browse files
app.py
CHANGED
|
@@ -1,37 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
from typing import Iterator
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
import torch
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
DEFAULT_SYSTEM_PROMPT = """\
|
| 10 |
-
You are a helpful, respectful and honest assistant with a deep knowledge of code and software design. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.\
|
| 11 |
-
"""
|
| 12 |
-
MAX_MAX_NEW_TOKENS = 4096
|
| 13 |
-
DEFAULT_MAX_NEW_TOKENS = 1024
|
| 14 |
-
MAX_INPUT_TOKEN_LENGTH = 4000
|
| 15 |
-
|
| 16 |
-
DESCRIPTION = """
|
| 17 |
-
# Code Llama 13B Chat
|
| 18 |
-
This Space demonstrates model [CodeLlama-13b-Instruct](https://huggingface.co/codellama/CodeLlama-13b-Instruct-hf) by Meta, a Code Llama model with 13B parameters fine-tuned for chat instructions and specialized on code tasks. Feel free to play with it, or duplicate to run generations without a queue! If you want to run your own service, you can also [deploy the model on Inference Endpoints](https://huggingface.co/inference-endpoints).
|
| 19 |
-
🔎 For more details about the Code Llama family of models and how to use them with `transformers`, take a look [at our blog post](https://huggingface.co/blog/codellama) or [the paper](https://huggingface.co/papers/2308.12950).
|
| 20 |
-
🏃🏻 Check out our [Playground](https://huggingface.co/spaces/codellama/codellama-playground) for a super-fast code completion demo that leverages a streaming [inference endpoint](https://huggingface.co/inference-endpoints).
|
| 21 |
-
💪 For a chat demo of the largest Code Llama model (34B parameters), you can [select Code Llama in Hugging Chat!](https://huggingface.co/chat/)
|
| 22 |
-
"""
|
| 23 |
-
|
| 24 |
-
LICENSE = """
|
| 25 |
-
<p/>
|
| 26 |
-
---
|
| 27 |
-
As a derivate work of Code Llama by Meta,
|
| 28 |
-
this demo is governed by the original [license](https://huggingface.co/spaces/huggingface-projects/codellama-2-13b-chat/blob/main/LICENSE.txt) and [acceptable use policy](https://huggingface.co/spaces/huggingface-projects/codellama-2-13b-chat/blob/main/USE_POLICY.md).
|
| 29 |
-
"""
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
def greet(name):
|
| 36 |
return "Hello " + name + "!!"
|
| 37 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
def greet(name):
|
| 4 |
return "Hello " + name + "!!"
|
| 5 |
|