Spaces:
Sleeping
Sleeping
remove device
Browse files
a.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
from gradio_client import Client
|
2 |
|
|
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
)
|
9 |
-
print(
|
|
|
1 |
from gradio_client import Client
|
2 |
|
3 |
+
client = Client("https://huggingface.co/spaces/wiklif/mixtral-api")
|
4 |
|
5 |
+
# Przykładowe dane wejściowe
|
6 |
+
prompt = "Jak się masz?"
|
7 |
+
history = []
|
8 |
+
|
9 |
+
response = client.predict(prompt, history)
|
10 |
+
print(response)
|
app.py
CHANGED
@@ -3,9 +3,6 @@ import gradio as gr
|
|
3 |
import torch
|
4 |
import spaces
|
5 |
|
6 |
-
# Sprawdź, czy CUDA jest dostępne
|
7 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
-
|
9 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
10 |
|
11 |
def format_prompt(message, history):
|
@@ -32,7 +29,6 @@ def generate(
|
|
32 |
repetition_penalty=repetition_penalty,
|
33 |
do_sample=True,
|
34 |
seed=42,
|
35 |
-
device=device, # Dodajemy obsługę CUDA
|
36 |
)
|
37 |
|
38 |
formatted_prompt = format_prompt(prompt, history)
|
|
|
3 |
import torch
|
4 |
import spaces
|
5 |
|
|
|
|
|
|
|
6 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
7 |
|
8 |
def format_prompt(message, history):
|
|
|
29 |
repetition_penalty=repetition_penalty,
|
30 |
do_sample=True,
|
31 |
seed=42,
|
|
|
32 |
)
|
33 |
|
34 |
formatted_prompt = format_prompt(prompt, history)
|