Spaces:
Runtime error
Runtime error
Update processing.py
Browse files- processing.py +4 -6
processing.py
CHANGED
@@ -52,7 +52,6 @@ class LazyPipeline:
|
|
52 |
top_p = 0.9,
|
53 |
top_k = 50,
|
54 |
repetition_penalty = 1.2,
|
55 |
-
device_map="auto",
|
56 |
)
|
57 |
return self.pipeline
|
58 |
|
@@ -105,10 +104,9 @@ class LazyChains:
|
|
105 |
)
|
106 |
return self.attachments_chain, self.bigfive_chain, self.personalities_chain
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
return LazyChains(lazy_llm)
|
112 |
|
113 |
# Load instruction files
|
114 |
def load_instructions(file_path):
|
@@ -140,7 +138,6 @@ def detect_language(text):
|
|
140 |
|
141 |
# Analysis functions
|
142 |
def analyze_content(content, safe_progress):
|
143 |
-
lazy_chains = get_lazy_chains()
|
144 |
attachments_chain, bigfive_chain, personalities_chain = lazy_chains.get_chains()
|
145 |
|
146 |
safe_progress(0.6, desc="Analyzing attachments...")
|
@@ -157,6 +154,7 @@ def analyze_content(content, safe_progress):
|
|
157 |
|
158 |
return attachments_answer, bigfive_answer, personalities_answer
|
159 |
|
|
|
160 |
# Main processing function
|
161 |
def process_input(input_file, progress=None):
|
162 |
start_time = time.time()
|
|
|
52 |
top_p = 0.9,
|
53 |
top_k = 50,
|
54 |
repetition_penalty = 1.2,
|
|
|
55 |
)
|
56 |
return self.pipeline
|
57 |
|
|
|
104 |
)
|
105 |
return self.attachments_chain, self.bigfive_chain, self.personalities_chain
|
106 |
|
107 |
+
lazy_pipe = LazyPipeline()
|
108 |
+
lazy_llm = LazyLLM(lazy_pipe)
|
109 |
+
lazy_chains = LazyChains(lazy_llm)
|
|
|
110 |
|
111 |
# Load instruction files
|
112 |
def load_instructions(file_path):
|
|
|
138 |
|
139 |
# Analysis functions
|
140 |
def analyze_content(content, safe_progress):
|
|
|
141 |
attachments_chain, bigfive_chain, personalities_chain = lazy_chains.get_chains()
|
142 |
|
143 |
safe_progress(0.6, desc="Analyzing attachments...")
|
|
|
154 |
|
155 |
return attachments_answer, bigfive_answer, personalities_answer
|
156 |
|
157 |
+
|
158 |
# Main processing function
|
159 |
def process_input(input_file, progress=None):
|
160 |
start_time = time.time()
|