nnsohamnn commited on
Commit
f7a2e91
·
verified ·
1 Parent(s): 1c62281

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -15,7 +15,7 @@ with open("textgen_tokenizer.pkl", "rb") as f:
15
  textgen_tokenizer = pickle.load(f)
16
 
17
  # === Settings ===
18
- CLASS_LABELS = ['label_0', 'label_1', 'label_2'] # Replace with actual labels
19
  MAX_LEN_CLASSIFIER = 100
20
  MAX_LEN_TEXTGEN = 50
21
 
@@ -29,7 +29,7 @@ def classify_text(text):
29
 
30
 
31
  # === Text Generation with Top-k Sampling ===
32
- def generate_text(seed_text, next_words=30, k=10, temperature=0.9):
33
  recent_words = set()
34
  for _ in range(next_words):
35
  token_list = textgen_tokenizer.texts_to_sequences([seed_text])[0]
 
15
  textgen_tokenizer = pickle.load(f)
16
 
17
  # === Settings ===
18
+ CLASS_LABELS = ['Science', 'Math', 'History'] # Replace with actual labels
19
  MAX_LEN_CLASSIFIER = 100
20
  MAX_LEN_TEXTGEN = 50
21
 
 
29
 
30
 
31
  # === Text Generation with Top-k Sampling ===
32
+ def generate_text(seed_text, next_words=15, k=10, temperature=0.9):
33
  recent_words = set()
34
  for _ in range(next_words):
35
  token_list = textgen_tokenizer.texts_to_sequences([seed_text])[0]