SantanuBanerjee commited on
Commit
2b42392
·
verified ·
1 Parent(s): 9a4ac65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -360,6 +360,7 @@ def create_cluster_dataframes(processed_df):
360
 
361
  from transformers import GPTNeoForCausalLM, GPT2Tokenizer
362
  def generate_project_proposal(problem_descriptions, location, problem_domain):
 
363
  model = GPTNeoForCausalLM.from_pretrained("EleutherAI/gpt-neo-1.3B")
364
  tokenizer = GPT2Tokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
365
 
@@ -379,6 +380,7 @@ def generate_project_proposal(problem_descriptions, location, problem_domain):
379
  temperature=0.75)
380
 
381
  proposal = tokenizer.decode(output[0], skip_special_tokens=True)
 
382
  return proposal
383
 
384
  def create_project_proposals(budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters):
@@ -467,9 +469,13 @@ def nlp_pipeline(original_df):
467
  print("Clustering Done...")
468
  # return processed_df, budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters
469
 
 
 
470
  # # Generate project proposals
471
  location_clusters = dict(enumerate(processed_df['Location_Category_Words'].unique()))
472
  problem_clusters = dict(enumerate(processed_df['Problem_Category_Words'].unique()))
 
 
473
  project_proposals = create_project_proposals(budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters)
474
 
475
  console_messages.append("NLP pipeline completed.")
 
360
 
361
  from transformers import GPTNeoForCausalLM, GPT2Tokenizer
362
  def generate_project_proposal(problem_descriptions, location, problem_domain):
363
+ print("Trying to access gpt-neo-1.3B")
364
  model = GPTNeoForCausalLM.from_pretrained("EleutherAI/gpt-neo-1.3B")
365
  tokenizer = GPT2Tokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
366
 
 
380
  temperature=0.75)
381
 
382
  proposal = tokenizer.decode(output[0], skip_special_tokens=True)
383
+ print("Successfully accessed gpt-neo-1.3B and returning")
384
  return proposal
385
 
386
  def create_project_proposals(budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters):
 
469
  print("Clustering Done...")
470
  # return processed_df, budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters
471
 
472
+ print("location_clusters: ", location_clusters)
473
+ print("problem_clusters: ", problem_clusters)
474
  # # Generate project proposals
475
  location_clusters = dict(enumerate(processed_df['Location_Category_Words'].unique()))
476
  problem_clusters = dict(enumerate(processed_df['Problem_Category_Words'].unique()))
477
+ print("location_clusters: ", location_clusters)
478
+ print("problem_clusters: ", problem_clusters)
479
  project_proposals = create_project_proposals(budget_cluster_df, problem_cluster_df, location_clusters, problem_clusters)
480
 
481
  console_messages.append("NLP pipeline completed.")