Spaces:
Build error
Build error
refact friendly
Browse files
app.py
CHANGED
@@ -6,17 +6,10 @@ import requests
|
|
6 |
import gradio as gr
|
7 |
from huggingface_hub import Repository
|
8 |
from text_generation import Client
|
|
|
9 |
|
10 |
from share_btn import community_icon_html, loading_icon_html, share_js, share_btn_css
|
11 |
|
12 |
-
#HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
13 |
-
|
14 |
-
#API_URL = "https://api-inference.huggingface.co/models/bigcode/starcoder"
|
15 |
-
#API_URL_BASE ="https://api-inference.huggingface.co/models/bigcode/starcoderbase"
|
16 |
-
#API_URL_PLUS = "https://api-inference.huggingface.co/models/bigcode/starcoderplus"
|
17 |
-
|
18 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
19 |
-
|
20 |
checkpoint = "smallcloudai/Refact-1_6B-fim"
|
21 |
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
22 |
|
@@ -156,28 +149,24 @@ css += share_btn_css + monospace_css + ".gradio-container {color: black}"
|
|
156 |
|
157 |
description = """
|
158 |
<div style="text-align: center;">
|
159 |
-
<h1>
|
160 |
</div>
|
161 |
<div style="text-align: left;">
|
162 |
-
<p>This is a demo to generate text and code with the following
|
163 |
<ul>
|
164 |
-
<li><a href="https://huggingface.co/
|
165 |
-
<li><a href="https://huggingface.co/bigcode/starcoderbase" style='color: #e6b800;'>StarCoderBase</a>: A code generation model trained on 80+ programming languages, providing broad language coverage for code generation tasks.</li>
|
166 |
-
<li><a href="https://huggingface.co/bigcode/starcoder" style='color: #e6b800;'>StarCoder</a>: A finetuned version of StarCoderBase specifically focused on Python, while also maintaining strong performance on other programming languages.</li>
|
167 |
</ul>
|
168 |
<p><b>Please note:</b> These models are not designed for instruction purposes. If you're looking for instruction or want to chat with a fine-tuned model, you can visit the <a href="https://huggingface.co/spaces/HuggingFaceH4/starchat-playground">StarChat Playground</a>.</p>
|
169 |
</div>
|
170 |
"""
|
171 |
-
disclaimer = """⚠️<b>Any use or sharing of this demo constitues your acceptance of the BigCode [OpenRAIL-M](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement) License Agreement and the use restrictions included within.</b>\
|
172 |
-
<br>**Intended Use**: this app and its [supporting model](https://huggingface.co/bigcode) are provided for demonstration purposes; not to serve as replacement for human expertise. For more details on the model's limitations in terms of factuality and biases, see the [model card.](hf.co/bigcode)"""
|
173 |
|
174 |
with gr.Blocks(theme=theme, analytics_enabled=False, css=css) as demo:
|
175 |
with gr.Column():
|
176 |
gr.Markdown(description)
|
177 |
with gr.Row():
|
178 |
version = gr.Dropdown(
|
179 |
-
["
|
180 |
-
value="
|
181 |
label="Model",
|
182 |
info="Choose a model from the list",
|
183 |
)
|
|
|
6 |
import gradio as gr
|
7 |
from huggingface_hub import Repository
|
8 |
from text_generation import Client
|
9 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
10 |
|
11 |
from share_btn import community_icon_html, loading_icon_html, share_js, share_btn_css
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
checkpoint = "smallcloudai/Refact-1_6B-fim"
|
14 |
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
15 |
|
|
|
149 |
|
150 |
description = """
|
151 |
<div style="text-align: center;">
|
152 |
+
<h1> Refact 1.6B <span style='color: #e6b800;'>Models</span> Playground</h1>
|
153 |
</div>
|
154 |
<div style="text-align: left;">
|
155 |
+
<p>This is a demo to generate text and code with the following model:</p>
|
156 |
<ul>
|
157 |
+
<li><a href="https://huggingface.co/smallcloudai/Refact-1_6B-fim" style='color: #e6b800;'>ReFact 1.6B</a>: An Open-Source Coding Assistant with Fine-Tuning on codebase, autocompletion, code refactoring, code analysis, integrated chat and more</li>
|
|
|
|
|
158 |
</ul>
|
159 |
<p><b>Please note:</b> These models are not designed for instruction purposes. If you're looking for instruction or want to chat with a fine-tuned model, you can visit the <a href="https://huggingface.co/spaces/HuggingFaceH4/starchat-playground">StarChat Playground</a>.</p>
|
160 |
</div>
|
161 |
"""
|
|
|
|
|
162 |
|
163 |
with gr.Blocks(theme=theme, analytics_enabled=False, css=css) as demo:
|
164 |
with gr.Column():
|
165 |
gr.Markdown(description)
|
166 |
with gr.Row():
|
167 |
version = gr.Dropdown(
|
168 |
+
["Refact"],
|
169 |
+
value="Refact",
|
170 |
label="Model",
|
171 |
info="Choose a model from the list",
|
172 |
)
|