Spaces:
Runtime error
Runtime error
lionelgarnier
commited on
Commit
·
19bcaa7
1
Parent(s):
2836ec9
test mistral and flux 3
Browse files
app.py
CHANGED
@@ -1,10 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
|
|
4 |
import spaces
|
5 |
import torch
|
6 |
from diffusers import DiffusionPipeline
|
7 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
8 |
|
9 |
|
10 |
dtype = torch.bfloat16
|
@@ -15,9 +20,6 @@ pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", tor
|
|
15 |
MAX_SEED = np.iinfo(np.int32).max
|
16 |
MAX_IMAGE_SIZE = 2048
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
def refine_prompt(prompt):
|
22 |
gr.Info("Starting process")
|
23 |
chatbot = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.3")
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
4 |
+
import os
|
5 |
import spaces
|
6 |
import torch
|
7 |
from diffusers import DiffusionPipeline
|
8 |
from transformers import pipeline
|
9 |
+
from huggingface_hub import login
|
10 |
+
|
11 |
+
hf_token = os.environ['hf_token']
|
12 |
+
login(token=hf_token)
|
13 |
|
14 |
|
15 |
dtype = torch.bfloat16
|
|
|
20 |
MAX_SEED = np.iinfo(np.int32).max
|
21 |
MAX_IMAGE_SIZE = 2048
|
22 |
|
|
|
|
|
|
|
23 |
def refine_prompt(prompt):
|
24 |
gr.Info("Starting process")
|
25 |
chatbot = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.3")
|