arshiaafshani commited on
Commit
c081597
·
verified ·
1 Parent(s): 5d85f8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
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"