Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,13 +7,13 @@ from diffusers import AutoPipelineForText2Image
|
|
| 7 |
from threading import Thread
|
| 8 |
|
| 9 |
# ============================================================
|
| 10 |
-
# MODEL CONFIGURATION —
|
| 11 |
# ============================================================
|
| 12 |
-
LLM_MODEL_ID = "Qwen/Qwen3.8-27B
|
| 13 |
IMAGE_MODEL_ID = "stabilityai/stable-diffusion-xl-base-1.0"
|
| 14 |
|
| 15 |
print(f"[BOOT] Loading Tokenizer: {LLM_MODEL_ID}...")
|
| 16 |
-
tokenizer = AutoTokenizer.from_pretrained(LLM_MODEL_ID)
|
| 17 |
|
| 18 |
print(f"[BOOT] Loading LLM Model: {LLM_MODEL_ID} (4-bit Quantized)...")
|
| 19 |
bnb_config = BitsAndBytesConfig(
|
|
@@ -43,7 +43,7 @@ def get_image_pipe():
|
|
| 43 |
)
|
| 44 |
return pipe_image
|
| 45 |
|
| 46 |
-
print("[BOOT] Qwen3.8-27B
|
| 47 |
|
| 48 |
|
| 49 |
# ============================================================
|
|
@@ -53,7 +53,7 @@ print("[BOOT] Qwen3.8-27B-Instruct loaded globally successfully!")
|
|
| 53 |
@spaces.GPU
|
| 54 |
def chat_inference(message, history, system_prompt, temperature, max_tokens):
|
| 55 |
"""
|
| 56 |
-
ZeroGPU accelerated Qwen3.8-27B
|
| 57 |
"""
|
| 58 |
messages = []
|
| 59 |
if system_prompt:
|
|
@@ -121,7 +121,7 @@ with gr.Blocks(title="AI Backend - Qwen3.8-27B + SDXL (ZeroGPU)") as demo:
|
|
| 121 |
"""
|
| 122 |
# ⚡ Cloud AI Compute Backend (ZeroGPU)
|
| 123 |
Exposes zero-cost GPU endpoints:
|
| 124 |
-
- **LLM Chat**: `Qwen3.8-27B
|
| 125 |
- **Image Generation**: `SDXL 1.0`
|
| 126 |
"""
|
| 127 |
)
|
|
|
|
| 7 |
from threading import Thread
|
| 8 |
|
| 9 |
# ============================================================
|
| 10 |
+
# MODEL CONFIGURATION — Official Qwen3.8-27B repository ID
|
| 11 |
# ============================================================
|
| 12 |
+
LLM_MODEL_ID = "Qwen/Qwen3.8-27B"
|
| 13 |
IMAGE_MODEL_ID = "stabilityai/stable-diffusion-xl-base-1.0"
|
| 14 |
|
| 15 |
print(f"[BOOT] Loading Tokenizer: {LLM_MODEL_ID}...")
|
| 16 |
+
tokenizer = AutoTokenizer.from_pretrained(LLM_MODEL_ID, trust_remote_code=True)
|
| 17 |
|
| 18 |
print(f"[BOOT] Loading LLM Model: {LLM_MODEL_ID} (4-bit Quantized)...")
|
| 19 |
bnb_config = BitsAndBytesConfig(
|
|
|
|
| 43 |
)
|
| 44 |
return pipe_image
|
| 45 |
|
| 46 |
+
print("[BOOT] Qwen/Qwen3.8-27B loaded globally successfully!")
|
| 47 |
|
| 48 |
|
| 49 |
# ============================================================
|
|
|
|
| 53 |
@spaces.GPU
|
| 54 |
def chat_inference(message, history, system_prompt, temperature, max_tokens):
|
| 55 |
"""
|
| 56 |
+
ZeroGPU accelerated Qwen3.8-27B chat inference.
|
| 57 |
"""
|
| 58 |
messages = []
|
| 59 |
if system_prompt:
|
|
|
|
| 121 |
"""
|
| 122 |
# ⚡ Cloud AI Compute Backend (ZeroGPU)
|
| 123 |
Exposes zero-cost GPU endpoints:
|
| 124 |
+
- **LLM Chat**: `Qwen/Qwen3.8-27B` (4-bit Quantized)
|
| 125 |
- **Image Generation**: `SDXL 1.0`
|
| 126 |
"""
|
| 127 |
)
|