Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,16 @@ from peft import PeftModel
|
|
3 |
import gradio as gr
|
4 |
import os
|
5 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
7 |
print(device)
|
8 |
# Asegúrate de que tu token de Hugging Face está cargado como una variable de entorno
|
|
|
3 |
import gradio as gr
|
4 |
import os
|
5 |
import torch
|
6 |
+
|
7 |
+
os.system('pip install dashscope')
|
8 |
+
from http import HTTPStatus
|
9 |
+
import dashscope
|
10 |
+
from dashscope import Generation
|
11 |
+
from dashscope.api_entities.dashscope_response import Role
|
12 |
+
from typing import List, Optional, Tuple, Dict
|
13 |
+
from urllib.error import HTTPError
|
14 |
+
default_system = 'You are a helpful assistant.'
|
15 |
+
|
16 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
17 |
print(device)
|
18 |
# Asegúrate de que tu token de Hugging Face está cargado como una variable de entorno
|