Spaces:
Paused
Paused
Update app.py
Browse files改成智谱AI大模型,glm-4-9b
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import fitz # PyMuPDF for PDF handling
|
4 |
|
5 |
# Function to extract text from PDF
|
@@ -21,7 +21,8 @@ def analyze_document(file, prompt):
|
|
21 |
return "Unsupported file format. Please upload a PDF or TXT file."
|
22 |
|
23 |
# Load model and tokenizer
|
24 |
-
model_name = "Alibaba-NLP/gte-Qwen1.5-7B-instruct"
|
|
|
25 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
26 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
27 |
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModel
|
3 |
import fitz # PyMuPDF for PDF handling
|
4 |
|
5 |
# Function to extract text from PDF
|
|
|
21 |
return "Unsupported file format. Please upload a PDF or TXT file."
|
22 |
|
23 |
# Load model and tokenizer
|
24 |
+
# model_name = "Alibaba-NLP/gte-Qwen1.5-7B-instruct"
|
25 |
+
model_name = "THUDM/glm-4-9b"
|
26 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
27 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
28 |
|