Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
micpst committed Sep 4, 2024
1 parent f12f834 commit 29b15a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions examples/visualize_views_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
from dbally.llms.litellm import LiteLLM


async def main():
async def main() -> None:
await country_similarity.update()

llm = LiteLLM(model_name="gpt-3.5-turbo")
dbally.event_handlers = [CLIEventHandler(), BufferEventHandler()]

collection = dbally.create_collection("candidates", llm)
collection.add(CandidateView, lambda: CandidateView(engine))
collection.add(SampleText2SQLViewCyphers, lambda: SampleText2SQLViewCyphers(create_freeform_memory_engine()))
gradio_interface = await create_gradio_interface(user_collection=collection)

gradio_interface = create_gradio_interface(collection)
gradio_interface.launch()


Expand Down
10 changes: 5 additions & 5 deletions src/dbally/gradio/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def create_interface(self) -> gr.Interface:
interactive=bool(views),
max_lines=1,
)
query = gr.Textbox(
question = gr.Textbox(
label="Question",
placeholder="Enter your question",
interactive=bool(views),
Expand All @@ -226,14 +226,14 @@ def create_interface(self) -> gr.Interface:
label="Use Natural Language Responder",
interactive=bool(views),
)
query_button = gr.Button(
ask_button = gr.Button(
value="Ask",
variant="primary",
interactive=bool(views),
)
clear_button = gr.ClearButton(
value="Reset",
components=[query],
components=[question],
interactive=bool(views),
)

Expand Down Expand Up @@ -341,10 +341,10 @@ def create_interface(self) -> gr.Interface:
view_preview_label,
],
)
query_button.click(
ask_button.click(
fn=self._ask_collection,
inputs=[
query,
question,
model_name,
api_key,
natural_language_response_checkbox,
Expand Down

0 comments on commit 29b15a0

Please sign in to comment.