Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,12 @@ from PIL import Image
|
|
6 |
import torch
|
7 |
import spaces
|
8 |
|
9 |
-
from
|
|
|
|
|
|
|
10 |
|
|
|
11 |
"""
|
12 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
13 |
"""
|
@@ -52,6 +56,7 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
52 |
demo = gr.ChatInterface(
|
53 |
respond,
|
54 |
title="Enlight Innovations Limited -- Demo",
|
|
|
55 |
additional_inputs=[
|
56 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
57 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
|
|
6 |
import torch
|
7 |
import spaces
|
8 |
|
9 |
+
from transformers import LlavaNextProcessor, LlavaNextForConditionalGeneration, TextIteratorStreamer
|
10 |
+
processor = LlavaNextProcessor.from_pretrained("llava-hf/llava-v1.6-mistral-7b-hf")
|
11 |
+
model = LlavaNextForConditionalGeneration.from_pretrained("llava-hf/llava-v1.6-mistral-7b-hf", torch_dtype=torch.float16, low_cpu_mem_usage=True)
|
12 |
+
model.to("cuda:0")
|
13 |
|
14 |
+
from huggingface_hub import InferenceClient
|
15 |
"""
|
16 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
17 |
"""
|
|
|
56 |
demo = gr.ChatInterface(
|
57 |
respond,
|
58 |
title="Enlight Innovations Limited -- Demo",
|
59 |
+
description="This demo is desgined to illustrate our basic idea and feasibility in implementation."
|
60 |
additional_inputs=[
|
61 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
62 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|