SharmaAmit1818 commited on
Commit
1b8dd33
1 Parent(s): 1152b2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -2,11 +2,16 @@ import gradio as gr
2
  import pandas as pd
3
  from transformers import BertTokenizer, BertForSequenceClassification
4
  import torch
 
5
 
6
  # Load pre-trained TinyBERT model and tokenizer
7
  tokenizer = BertTokenizer.from_pretrained('huawei-noah/TinyBERT_General_4L_312D')
8
  model = BertForSequenceClassification.from_pretrained('huawei-noah/TinyBERT_General_4L_312D')
9
 
 
 
 
 
10
  # Function to process the CSV file and generate predictions
11
  def process_csv(file):
12
  try:
 
2
  import pandas as pd
3
  from transformers import BertTokenizer, BertForSequenceClassification
4
  import torch
5
+ from datasets import load_dataset
6
 
7
  # Load pre-trained TinyBERT model and tokenizer
8
  tokenizer = BertTokenizer.from_pretrained('huawei-noah/TinyBERT_General_4L_312D')
9
  model = BertForSequenceClassification.from_pretrained('huawei-noah/TinyBERT_General_4L_312D')
10
 
11
+ # Load dataset from Hugging Face repository
12
+ # Replace 'your-username' and 'your-dataset-name' with actual values
13
+ dataset = load_dataset('https://huggingface.co/SharmaAmit1818', data_files='data.csv')
14
+
15
  # Function to process the CSV file and generate predictions
16
  def process_csv(file):
17
  try: