Spaces:
Runtime error
Runtime error
Update processing.py
Browse files- processing.py +3 -4
processing.py
CHANGED
@@ -59,7 +59,7 @@ class SequentialAnalyzer:
|
|
59 |
tokenizer = AutoTokenizer.from_pretrained(model_name, use_auth_token=self.hf_token)
|
60 |
model = AutoModelForCausalLM.from_pretrained(
|
61 |
model_name,
|
62 |
-
torch_dtype=torch.
|
63 |
device_map="auto",
|
64 |
use_auth_token=self.hf_token
|
65 |
)
|
@@ -75,10 +75,10 @@ class SequentialAnalyzer:
|
|
75 |
"text-generation",
|
76 |
model=model,
|
77 |
tokenizer=tokenizer,
|
78 |
-
max_new_tokens=
|
79 |
temperature=0.4,
|
80 |
top_p=0.9,
|
81 |
-
top_k=
|
82 |
repetition_penalty=1.2,
|
83 |
)
|
84 |
|
@@ -102,7 +102,6 @@ class SequentialAnalyzer:
|
|
102 |
input_variables=["context", "question"]
|
103 |
)
|
104 |
|
105 |
-
@spaces.GPU(duration=600) # Increased duration to account for all tasks
|
106 |
def analyze_content(self, content, safe_progress):
|
107 |
safe_progress(0.6, desc="Analyzing attachments...")
|
108 |
attachments_answer = self.analyze_task(content, attachments_task, attachments_db)
|
|
|
59 |
tokenizer = AutoTokenizer.from_pretrained(model_name, use_auth_token=self.hf_token)
|
60 |
model = AutoModelForCausalLM.from_pretrained(
|
61 |
model_name,
|
62 |
+
torch_dtype=torch.float16,
|
63 |
device_map="auto",
|
64 |
use_auth_token=self.hf_token
|
65 |
)
|
|
|
75 |
"text-generation",
|
76 |
model=model,
|
77 |
tokenizer=tokenizer,
|
78 |
+
max_new_tokens=400,
|
79 |
temperature=0.4,
|
80 |
top_p=0.9,
|
81 |
+
top_k=35,
|
82 |
repetition_penalty=1.2,
|
83 |
)
|
84 |
|
|
|
102 |
input_variables=["context", "question"]
|
103 |
)
|
104 |
|
|
|
105 |
def analyze_content(self, content, safe_progress):
|
106 |
safe_progress(0.6, desc="Analyzing attachments...")
|
107 |
attachments_answer = self.analyze_task(content, attachments_task, attachments_db)
|