Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
3 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Load model and tokenizer
|
6 |
model_name = "arshiaafshani/Arsh-llm"
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
3 |
import torch
|
4 |
+
from gradio_client import utils as client_utils
|
5 |
+
|
6 |
+
# پچ کردن تابع get_type
|
7 |
+
def patched_get_type(schema):
|
8 |
+
if isinstance(schema, bool):
|
9 |
+
return "any" if schema else "never"
|
10 |
+
if "const" in schema:
|
11 |
+
return repr(schema["const"])
|
12 |
+
if "type" in schema:
|
13 |
+
return schema["type"]
|
14 |
+
return "any"
|
15 |
+
|
16 |
+
client_utils.get_type = patched_get_type
|
17 |
|
18 |
# Load model and tokenizer
|
19 |
model_name = "arshiaafshani/Arsh-llm"
|