ogerly commited on
Commit
57223eb
·
1 Parent(s): 87d538c

add huggingface_app.py

Browse files
Files changed (3) hide show
  1. README.md +1 -2
  2. app.py +3 -8
  3. huggingface_app.py +15 -0
README.md CHANGED
@@ -3,8 +3,7 @@ title: CofifoAIWO
3
  emoji: 📁
4
  colorFrom: blue
5
  colorTo: green
6
- sdk: gradio
7
- sdk_version: 3.50.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
3
  emoji: 📁
4
  colorFrom: blue
5
  colorTo: green
6
+ sdk: flask
 
7
  app_file: app.py
8
  pinned: false
9
  license: mit
app.py CHANGED
@@ -240,13 +240,8 @@ def download_file(filename):
240
  if __name__ == '__main__':
241
  # Check if running on Hugging Face Spaces
242
  if os.environ.get('SPACE_ID'):
243
- import gradio as gr
244
-
245
- def greet(name):
246
- return "Hello " + name + "!!"
247
-
248
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
249
- demo.launch()
250
  else:
251
- # Default behavior for local development and GitHub
252
  app.run(debug=True, port=5000)
 
240
  if __name__ == '__main__':
241
  # Check if running on Hugging Face Spaces
242
  if os.environ.get('SPACE_ID'):
243
+ # Use port 7860 when running on Hugging Face Spaces
244
+ app.run(host='0.0.0.0', port=7860)
 
 
 
 
 
245
  else:
246
+ # Default behavior for local development
247
  app.run(debug=True, port=5000)
huggingface_app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet(name):
4
+ return "Hello " + name + "!! Welcome to CofifoAIWO - Combine Files for AI Workflows"
5
+
6
+ demo = gr.Interface(
7
+ fn=greet,
8
+ inputs=gr.Textbox(placeholder="Enter your name"),
9
+ outputs="text",
10
+ title="CofifoAIWO",
11
+ description="Combine Files for AI Workflows - Tool to combine multiple files and directories into a single text file."
12
+ )
13
+
14
+ if __name__ == "__main__":
15
+ demo.launch()