Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import AutoTokenizer, AutoModelForCausalLM, set_seed, pipeline
|
| 3 |
|
| 4 |
-
title = "SantaCoder 🎅
|
| 5 |
-
description = "This is a subspace to make code generation with [SantaCoder fine-tuned on The Stack
|
| 6 |
-
EXAMPLE_0 = "
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
tokenizer = AutoTokenizer.from_pretrained("mrm8488/santacoder-finetuned-the-stack-bash-4")
|
| 15 |
-
model = AutoModelForCausalLM.from_pretrained("mrm8488/santacoder-finetuned-the-stack-bash-4", trust_remote_code=True)
|
| 16 |
|
| 17 |
|
| 18 |
def code_generation(gen_prompt, max_tokens, temperature=0.6, seed=42):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import AutoTokenizer, AutoModelForCausalLM, set_seed, pipeline
|
| 3 |
|
| 4 |
+
title = "SantaCoder 🎅 Dockerfiles 🐋 Completion"
|
| 5 |
+
description = "This is a subspace to make code generation with [SantaCoder fine-tuned on The Stack Dockerfiles](https://huggingface.co/mrm8488/santacoder-finetuned-the-stack-dockerfiles)"
|
| 6 |
+
EXAMPLE_0 = "# Dockerfile for Express API"
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
CKPT = "mrm8488/santacoder-finetuned-the-stack-dockerfiles"
|
| 10 |
+
|
| 11 |
+
examples = [[EXAMPLE_0, 55, 0.6, 42]]
|
| 12 |
+
tokenizer = AutoTokenizer.from_pretrained(CKPT)
|
| 13 |
+
model = AutoModelForCausalLM.from_pretrained(CKPT, trust_remote_code=True)
|
|
|
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
def code_generation(gen_prompt, max_tokens, temperature=0.6, seed=42):
|