Spaces:
Runtime error
Runtime error
krystian-lieber
commited on
Commit
•
ebc2281
1
Parent(s):
8b78156
Minor changes
Browse files
README.md
CHANGED
@@ -12,8 +12,5 @@ suggested_hardware: a10g-small
|
|
12 |
duplicated_from: codellama/codellama-13b-chat
|
13 |
---
|
14 |
|
15 |
-
#
|
16 |
-
|
17 |
-
Llama v2 was introduced in [this paper](https://arxiv.org/abs/2307.09288).
|
18 |
-
|
19 |
-
This Space demonstrates [Llama-2-13b-chat-hf](meta-llama/Llama-2-13b-chat-hf) from Meta. Please, check the original model card for details.
|
|
|
12 |
duplicated_from: codellama/codellama-13b-chat
|
13 |
---
|
14 |
|
15 |
+
# CodeLlama-34b-Instruct Demo
|
16 |
+
This is a clone of https://huggingface.co/spaces/codellama/codellama-13b-chat changed to use free inference API for CodeLlama-34b-Instruct model
|
|
|
|
|
|
app.py
CHANGED
@@ -1,9 +1,12 @@
|
|
|
|
1 |
from typing import Iterator
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
from model import run
|
6 |
|
|
|
|
|
7 |
DEFAULT_SYSTEM_PROMPT = """\
|
8 |
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.\
|
9 |
"""
|
@@ -270,4 +273,4 @@ with gr.Blocks(css='style.css') as demo:
|
|
270 |
api_name=False,
|
271 |
)
|
272 |
|
273 |
-
demo.queue(max_size=32).launch(
|
|
|
1 |
+
import os
|
2 |
from typing import Iterator
|
3 |
|
4 |
import gradio as gr
|
5 |
|
6 |
from model import run
|
7 |
|
8 |
+
HF_PUBLIC = os.environ.get("HF_PUBLIC", False)
|
9 |
+
|
10 |
DEFAULT_SYSTEM_PROMPT = """\
|
11 |
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.\
|
12 |
"""
|
|
|
273 |
api_name=False,
|
274 |
)
|
275 |
|
276 |
+
demo.queue(max_size=32).launch(share=HF_PUBLIC)
|
model.py
CHANGED
@@ -6,7 +6,7 @@ from text_generation import Client
|
|
6 |
model_id = 'codellama/CodeLlama-34b-Instruct-hf'
|
7 |
|
8 |
API_URL = "https://api-inference.huggingface.co/models/" + model_id
|
9 |
-
HF_TOKEN = os.environ.get("HF_TOKEN",
|
10 |
|
11 |
client = Client(
|
12 |
API_URL,
|
|
|
6 |
model_id = 'codellama/CodeLlama-34b-Instruct-hf'
|
7 |
|
8 |
API_URL = "https://api-inference.huggingface.co/models/" + model_id
|
9 |
+
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
10 |
|
11 |
client = Client(
|
12 |
API_URL,
|