Spaces:
Sleeping
Sleeping
Commit
Β·
574567c
1
Parent(s):
f304d39
Changed model
Browse files
README.md
CHANGED
@@ -29,8 +29,9 @@ Whether you're building bridges, drawing algorithms, or debugging with divine fl
|
|
29 |
π€ Hosted on Hugging Face Spaces
|
30 |
|
31 |
Try asking:
|
|
|
32 |
- "Write a Python function to calculate Fibonacci numbers"
|
33 |
- "Explain recursion like you're Leonardo da Vinci"
|
34 |
- "Generate a JavaScript function to toggle dark mode"
|
35 |
|
36 |
-
---
|
|
|
29 |
π€ Hosted on Hugging Face Spaces
|
30 |
|
31 |
Try asking:
|
32 |
+
|
33 |
- "Write a Python function to calculate Fibonacci numbers"
|
34 |
- "Explain recursion like you're Leonardo da Vinci"
|
35 |
- "Generate a JavaScript function to toggle dark mode"
|
36 |
|
37 |
+
---
|
app.py
CHANGED
@@ -2,8 +2,9 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
-
|
6 |
-
|
|
|
7 |
|
8 |
def generate_code(prompt, style="Clean & Pythonic"):
|
9 |
if style == "Verbose like a 15th-century manuscript":
|
@@ -24,7 +25,7 @@ demo = gr.Interface(
|
|
24 |
gr.Dropdown(["Clean & Pythonic", "Verbose like a 15th-century manuscript"], label="Code Style")
|
25 |
],
|
26 |
outputs=gr.Code(label="π§Ύ Leonardo's Work"),
|
27 |
-
title="Codice Da Vinci
|
28 |
description="Your Renaissance coding assistant. Fluent in algorithms and Latin. Powered by LLM."
|
29 |
)
|
30 |
|
|
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
+
# deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-1.3b-instruct") # Or your own!
|
7 |
+
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-1.3b-instruct", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True)
|
8 |
|
9 |
def generate_code(prompt, style="Clean & Pythonic"):
|
10 |
if style == "Verbose like a 15th-century manuscript":
|
|
|
25 |
gr.Dropdown(["Clean & Pythonic", "Verbose like a 15th-century manuscript"], label="Code Style")
|
26 |
],
|
27 |
outputs=gr.Code(label="π§Ύ Leonardo's Work"),
|
28 |
+
title="Codice Da Vinci ππ»",
|
29 |
description="Your Renaissance coding assistant. Fluent in algorithms and Latin. Powered by LLM."
|
30 |
)
|
31 |
|