Spaces:
Sleeping
Sleeping
File size: 989 Bytes
b9b4796 f13a3ca 65e80e3 f13a3ca 9e57aa8 80e0122 9e57aa8 80e0122 9e57aa8 80e0122 9e57aa8 80e0122 9e57aa8 f13a3ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
import os
os.system('pip install transformers')
# Import the necessary libraries
import os
os.system('pip install torch')
from transformers import AutoModel, AutoTokenizer
import torch
from torch.utils.data import DataLoader, Dataset
from sklearn.model_selection import train_test_split
import pandas as pd
import gradio as gr
# Load the pre-trained model and tokenizer
model = AutoModel.from_pretrained("Alibaba-NLP/gte-multilingual-base", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("Alibaba-NLP/gte-multilingual-base", trust_remote_code=True)
# Example Gradio function
def search_by_name(name):
# Your logic to search by name and return a response
pass
# Gradio interface
iface = gr.Interface(
fn=search_by_name,
inputs=gr.Textbox(label="Please write your Name"),
outputs=gr.Textbox(label="Your PEC number"),
title="PEC Number Lookup",
description="Enter your name to find your PEC number."
)
# Launch the interface
iface.launch()
|