pokeberrypie commited on
Commit
9ffc3ef
1 Parent(s): 4be8187

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -1,7 +1,17 @@
1
  import gradio as gr
2
  from transformers import pipeline, AutoConfig
 
3
 
4
- # Explicitly load the configuration with trust_remote_code
 
 
 
 
 
 
 
 
 
5
  config = AutoConfig.from_pretrained('tiiuae/falcon-40b-instruct', trust_remote_code=True)
6
 
7
  # Load the model once when the script starts using the loaded config
 
1
  import gradio as gr
2
  from transformers import pipeline, AutoConfig
3
+ import logging
4
 
5
+ # Temporary workaround: Extend the Logger class to include warning_once
6
+ def warning_once(self, msg, *args, **kwargs):
7
+ if msg not in self._warned:
8
+ self.warning(msg, *args, **kwargs)
9
+ self._warned.add(msg)
10
+
11
+ logging.Logger.warning_once = warning_once
12
+ logging.Logger._warned = set()
13
+
14
+ # Load the model configuration with trust_remote_code to execute local configuration
15
  config = AutoConfig.from_pretrained('tiiuae/falcon-40b-instruct', trust_remote_code=True)
16
 
17
  # Load the model once when the script starts using the loaded config