Skip to content

pyyush/MLM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Masked Language Modeling

Setup

Before running the code, please ensure that you have installed the required dependencies mentioned in the requirements.txt file. You can do this by running the following command in your terminal:

pip3 install -r requirements.txt

FastAPI

To run the FastAPI web server, you can use the following command in your terminal:

uvicorn fastAPI:app 

Once the server is up and running, you can access the Swagger documentation for the API at http://127.0.0.1:8000/docs
Alternatively, you can use the curl command to test the API as shown below:

curl -X 'POST' \
  'http://127.0.0.1:8000/predict' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "Hello <mask>",
  "model": "xlm-roberta-base"
}'

Gradio

To run the Gradio web application, you can use the following command in your terminal:

python3 Gradio.py

Once the server is up and running, you can access the web application at http://127.0.0.1:7860