Spaces:
Sleeping
Sleeping
Commit
·
627e6af
1
Parent(s):
1514f66
chore: download onnx-data on spaces
Browse filesSigned-off-by: Suvaditya Mukherjee <suvadityamuk@gmail.com>
app.py
CHANGED
@@ -102,7 +102,9 @@ if __name__ == "__main__":
|
|
102 |
|
103 |
ONNX_MODEL_PATH = "https://huggingface.co/onnx-community/Qwen2.5-1.5B-Instruct/resolve/main/onnx/model.onnx_data"
|
104 |
|
|
|
105 |
response = requests.get(ONNX_MODEL_PATH, stream=True)
|
|
|
106 |
|
107 |
# Download file
|
108 |
download_pdf_from_gdrive(RESUME_URL, RESUME_PATH)
|
@@ -149,9 +151,9 @@ if __name__ == "__main__":
|
|
149 |
# }
|
150 |
# )
|
151 |
|
152 |
-
wandb.login(
|
153 |
-
|
154 |
-
)
|
155 |
|
156 |
@spaces.GPU
|
157 |
def rag_process(message, chat_history):
|
|
|
102 |
|
103 |
ONNX_MODEL_PATH = "https://huggingface.co/onnx-community/Qwen2.5-1.5B-Instruct/resolve/main/onnx/model.onnx_data"
|
104 |
|
105 |
+
print("Downloading ONNX model...")
|
106 |
response = requests.get(ONNX_MODEL_PATH, stream=True)
|
107 |
+
print("Downloaded ONNX model!")
|
108 |
|
109 |
# Download file
|
110 |
download_pdf_from_gdrive(RESUME_URL, RESUME_PATH)
|
|
|
151 |
# }
|
152 |
# )
|
153 |
|
154 |
+
# wandb.login(
|
155 |
+
# key=os.getenv("WANDB_API_KEY")
|
156 |
+
# )
|
157 |
|
158 |
@spaces.GPU
|
159 |
def rag_process(message, chat_history):
|
utils.py
CHANGED
@@ -181,7 +181,7 @@ def scrape_website(start_url, delay=1):
|
|
181 |
|
182 |
def onnx_inference(chat_history, rag_query, tokenizer):
|
183 |
# Create ONNX Runtime session
|
184 |
-
session = onnxruntime.InferenceSession("model.onnx"
|
185 |
|
186 |
# Tokenize input text
|
187 |
inputs = tokenizer.apply_chat_template(
|
|
|
181 |
|
182 |
def onnx_inference(chat_history, rag_query, tokenizer):
|
183 |
# Create ONNX Runtime session
|
184 |
+
session = onnxruntime.InferenceSession("model.onnx")
|
185 |
|
186 |
# Tokenize input text
|
187 |
inputs = tokenizer.apply_chat_template(
|