Spaces:
Runtime error
Runtime error
import gradio as gr | |
import pandas as pd | |
def wrap_chroma_query(query, num_result): | |
results = chroma_query(query, num_result) | |
# Convertir los resultados a un DataFrame | |
data = [] | |
for i, metadata in enumerate(results['metadatas'][0]): | |
metadata['document'] = results['documents'][0][i] | |
data.append(metadata) | |
df_results = pd.DataFrame(data) | |
return df_results | |
iface = gr.Interface( | |
fn=wrap_chroma_query, | |
inputs=["text",gr.Slider(1,10,1)], | |
outputs="text", | |
title="Movie Search", | |
description="Search for movies using Chroma", | |
) | |
iface.launch() |