Update app.py
Browse files
app.py
CHANGED
@@ -16,13 +16,24 @@ try:
|
|
16 |
tools = mcp_client.get_tools()
|
17 |
|
18 |
# model = InferenceClientModel()
|
19 |
-
model = TransformersModel(
|
20 |
-
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
21 |
-
device="cuda",
|
22 |
-
max_new_tokens=5000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
)
|
|
|
|
|
24 |
agent = CodeAgent(tools=[*tools], model=model)
|
25 |
|
|
|
|
|
26 |
# Define Gradio ChatInterface
|
27 |
demo = gr.ChatInterface(
|
28 |
fn=lambda message, history: str(agent.run(message)),
|
|
|
16 |
tools = mcp_client.get_tools()
|
17 |
|
18 |
# model = InferenceClientModel()
|
19 |
+
# model = TransformersModel(
|
20 |
+
# model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
21 |
+
# device="cuda",
|
22 |
+
# max_new_tokens=5000,
|
23 |
+
# )
|
24 |
+
model_id = "unsloth/Llama-3.2-1B"
|
25 |
+
|
26 |
+
model = AutoModelForCausalLM.from_pretrained(
|
27 |
+
model_id,
|
28 |
+
torch_dtype=torch.bfloat16,
|
29 |
+
device_map="auto"
|
30 |
)
|
31 |
+
|
32 |
+
|
33 |
agent = CodeAgent(tools=[*tools], model=model)
|
34 |
|
35 |
+
|
36 |
+
|
37 |
# Define Gradio ChatInterface
|
38 |
demo = gr.ChatInterface(
|
39 |
fn=lambda message, history: str(agent.run(message)),
|