Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import numpy as np
|
2 |
import pandas as pd
|
3 |
import os
|
@@ -13,6 +14,9 @@ from transformers import GPTJForCausalLM, GPT2TokenizerFast
|
|
13 |
import torch
|
14 |
import torch.multiprocessing as mp
|
15 |
|
|
|
|
|
|
|
16 |
# Initialize Example Emotions Dataset
|
17 |
data = {
|
18 |
'context': [
|
@@ -207,8 +211,8 @@ def get_emotional_response(context):
|
|
207 |
|
208 |
# Initialize the pre-trained language model
|
209 |
model_name = 'EleutherAI/gpt-j-6B'
|
210 |
-
tokenizer = GPT2TokenizerFast.from_pretrained(model_name)
|
211 |
-
lm_model = GPTJForCausalLM.from_pretrained(model_name)
|
212 |
|
213 |
# Multiprocessing context setting (ensure it's set only once)
|
214 |
if __name__ == '__main__':
|
|
|
1 |
+
import warnings
|
2 |
import numpy as np
|
3 |
import pandas as pd
|
4 |
import os
|
|
|
14 |
import torch
|
15 |
import torch.multiprocessing as mp
|
16 |
|
17 |
+
# Suppress specific warnings
|
18 |
+
warnings.filterwarnings('ignore', category=FutureWarning, module='huggingface_hub.file_download')
|
19 |
+
|
20 |
# Initialize Example Emotions Dataset
|
21 |
data = {
|
22 |
'context': [
|
|
|
211 |
|
212 |
# Initialize the pre-trained language model
|
213 |
model_name = 'EleutherAI/gpt-j-6B'
|
214 |
+
tokenizer = GPT2TokenizerFast.from_pretrained(model_name, force_download=True)
|
215 |
+
lm_model = GPTJForCausalLM.from_pretrained(model_name, force_download=True)
|
216 |
|
217 |
# Multiprocessing context setting (ensure it's set only once)
|
218 |
if __name__ == '__main__':
|