Tonic commited on
Commit
cefb8d8
1 Parent(s): 379aae7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -5,7 +5,7 @@ import os
5
  import torch
6
 
7
  # Set max_split_size_mb
8
- os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:50'
9
  title = """# 🙋🏻‍♂️Welcome to🌟Tonic's Nexus🐦‍⬛Raven"""
10
  description = """You can build with this endpoint using Nexus Raven. The demo is still a work in progress but we hope to add some endpoints for commonly used functions such as intention mappers and audiobook processing.
11
  You can also use Nexus🐦‍⬛Raven on your laptop & by cloning this space. 🧬🔬🔍 Simply click here: <a style="display:inline-block" href="https://huggingface.co/spaces/Tonic1/NexusRaven2?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></h3>
@@ -37,12 +37,18 @@ def create_interface():
37
  submit_button.click(converter.process_text, inputs=input_text, outputs=output_text)
38
  return app
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  if __name__ == "__main__":
41
- demo = gr.Interface(
42
- fn=process_text,
43
- inputs="text",
44
- outputs="text",
45
- title=title,
46
- description=description
47
- )
48
- demo.launch()
 
5
  import torch
6
 
7
  # Set max_split_size_mb
8
+ # os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:50'
9
  title = """# 🙋🏻‍♂️Welcome to🌟Tonic's Nexus🐦‍⬛Raven"""
10
  description = """You can build with this endpoint using Nexus Raven. The demo is still a work in progress but we hope to add some endpoints for commonly used functions such as intention mappers and audiobook processing.
11
  You can also use Nexus🐦‍⬛Raven on your laptop & by cloning this space. 🧬🔬🔍 Simply click here: <a style="display:inline-block" href="https://huggingface.co/spaces/Tonic1/NexusRaven2?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></h3>
 
37
  submit_button.click(converter.process_text, inputs=input_text, outputs=output_text)
38
  return app
39
 
40
+
41
+ def main():
42
+ with gr.Blocks() as demo:
43
+ gr.Markdown(title)
44
+ gr.Markdown(description)
45
+ with gr.Row():
46
+ input_text = gr.Textbox(label="Input Text", placeholder="Enter your text here...")
47
+ submit_button = gr.Button("Submit")
48
+ output_text = gr.Textbox(label="Nexus🐦‍⬛Raven", placeholder="Generated text will appear here...")
49
+ submit_button.click(process_text, inputs=input_text, outputs=output_text)
50
+
51
+ demo.launch()
52
+
53
  if __name__ == "__main__":
54
+ main()