sailormars18 commited on
Commit
a403fa8
·
1 Parent(s): a423ef0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  # Define a function for generating text based on a prompt using the fine-tuned GPT-2 model and the tokenizer
2
  def generate_text(prompt, length=100, theme=None, **kwargs):
3
  model_url = "https://huggingface.co/sailormars18/Yelp-reviews-usingGPT2"
 
1
+ import pandas as pd
2
+ import re
3
+ import subprocess
4
+ subprocess.run(["pip", "install", "transformers", "torch", "gradio"])
5
+ import gradio as gr
6
+ import torch
7
+ import transformers
8
+
9
  # Define a function for generating text based on a prompt using the fine-tuned GPT-2 model and the tokenizer
10
  def generate_text(prompt, length=100, theme=None, **kwargs):
11
  model_url = "https://huggingface.co/sailormars18/Yelp-reviews-usingGPT2"