This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gradio as gr | |
from pydantic import BaseModel | |
from jina import Flow, Executor, requests | |
from docarray import DocList, BaseDoc | |
from fastapi import FastAPI | |
from jina.serve.runtimes.gateway.http.fastapi import FastAPIBaseGateway | |
## helper function to convert pydantic model -> gradio interface | |
def generate_gradio_interface(model: BaseModel): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
sqlite_file = 'my_first_db.sqlite' # name of the sqlite database file | |
table_name1 = 'my_table_1' # name of the table to be created | |
table_name2 = 'my_table_2' # name of the table to be created | |
new_field = 'my_1st_column' # name of the column | |
field_type = 'INTEGER' # column data type | |
# Connecting to the database file | |
conn = sqlite3.connect(sqlite_file) |