File size: 584 Bytes
8446093
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
from transformers import pipeline

# Initialize the pipeline
pipe = pipeline("feature-extraction", model="ECOFRI/CXR-LLAVA-v2", trust_remote_code=True)

# Define a function to process inputs and return outputs
def extract_features(text):
    features = pipe(text)
    return features

# Create a Gradio interface
iface = gr.Interface(
    fn=extract_features, 
    inputs="text", 
    outputs="json",
    title="Feature Extraction Demo",
    description="Enter text to extract features using the ECOFRI/CXR-LLAVA-v2 model."
)

# Launch the interface
iface.launch()