jhj0517 / Whisper-WebUI

A Web UI for easy subtitle using whisper model.
Apache License 2.0
1.23k stars 175 forks source link

Change localhost to a different adress #79

Closed tingtongdpnw closed 6 months ago

tingtongdpnw commented 9 months ago

On which file i can change the localhost adress to a specific domain, so that for example other people in the company can use the WebUI?

jhj0517 commented 9 months ago

You can use some command line arguments to get what you want.

For example, you can run the project with python app.py --share --username MyUserName --password MyPassword

This will display a shareable URL and other people will need to know the username and password to use the webUI.

You can edit the arguments in the user-start-webui.bat file if you are using Windows. If you don't use Windows, you can just manually enter the cmd line arguments as above.

Here's the wiki on how to use these arguments.

tingtongdpnw commented 8 months ago

I run Whisper-WebUI on an Ubuntu Server, now i put an A-Record with a specific URL, to the IP of the Ubuntu Server. My goal is that once i open from outside the specific URL : example.xy.com , the Whisper-WebUI Website pops out. And btw there is just a user-start-webui.bat but shouldnt there also be user-start-webui.sh (for Linux etc).?

tingtongdpnw commented 8 months ago

root@ubuntu:/home//TestWhisoper/Whisper-WebUI# python app.py --share Use Faster Whisper implementation Device "cpu" is detected Traceback (most recent call last): File "/home//TestWhisoper/Whisper-WebUI/app.py", line 241, in app.launch() File "/home//TestWhisoper/Whisper-WebUI/app.py", line 48, in launch input_file = gr.Files(type="filepath", label="Upload File here") File "/usr/local/lib/python3.10/dist-packages/gradio/templates.py", line 420, in init super().init( File "/usr/local/lib/python3.10/dist-packages/gradio/components/file.py", line 93, in init raise ValueError( ValueError: Invalid value for parameter type: filepath. Please choose from one of: ['file', 'binary', 'bytes']

(btw can you show me here a screenshot/example, where you exactly change or put the informations, becaues there are parts in user-start-webui.bat and also in the app.py where you can put username and password information...)

i solved it by putting type= file instead of filepath... but since we need the parameter "file" for running the ./start.webui.sh , i created a second file, just in case when i want to create an accessible extern Link. Btw i also put an A-Record on the IP of my server, lets say i want to acces whisper-webui from outside with the subdomain "whisper.monk.com" ... my question is now where do i have to put/configure "whisper.monk.com" in those files?

tingtongdpnw commented 8 months ago

is there anybody who can help me here? im trying following the following thing here: https://www.gradio.app/guides/running-gradio-on-your-web-server-with-nginx

i just wanna run it on a specific domain, but im stuck in the part "gr.Interface(test, "textbox", "textbox").queue().launch(root_path="/gradio-demo")"

can anyone show just one example how he did it.

jhj0517 commented 8 months ago

Do you want to set a specific port? Seeing the launch option would be helpful. For example if you set

self.app.queue(api_open=False).launch(
   server_name="0.0.0.0",
   server_port="7877"
)

in the app.py, Then it will be hosted on http://0.0.0.0:7877

tingtongdpnw commented 8 months ago

No im still confused and dont get it. yes thats exactly what i want what you said, i definitely dont wanna do it with those Parser arguments --share --server_name Test.com etc... Btw if i would do that in the future, is there away that those links are available more then 72 hours? yes im sure there is one, but also for here i need one specific example with the exact command, for some reason i couldnt find anything. My goal is to set it up in the app.py file right away, like you said. But i still dont no which exact line i have to change that config, can you just show me where or where exactly to i copy the code block which you send above. Thank you for your help.

tingtongdpnw commented 7 months ago

can you show me here another example with a custom name, and where exactly do you put that in? in which file? @jhj0517

tingtongdpnw commented 7 months ago

here also another way: https://www.gradio.app/guides/running-gradio-on-your-web-server-with-nginx but i dont understand how to setup that part: "gr.Interface(test, "textbox", "textbox").queue().launch(root_path="/gradio-demo")" and where to put it. btw is there also a way to do it with caddy? when i try to reach my domain i get the info: " Not Found

The requested URL was not found on this server. Apache/2.4.10 (Debian) Server at www.test.test.com Port 80"

but what has apache to do with that? caddy runs on port 80 and nginx on port 81. i dont get it.

jhj0517 commented 7 months ago

Hi @tingtongdpnw, You can edit this part in app.py

https://github.com/jhj0517/Whisper-WebUI/blob/e216a046cf760143abf61cfa411409571a81fe34/app.py#L215-L224

Editing this part into

self.app.queue(api_open=False).launch(
   server_name="0.0.0.0",
   server_port="7877"
)

will host on http://0.0.0.0:7877

tingtongdpnw commented 7 months ago

ok now it works, btw you put the port in "", its int so for anyone who does the same do the port editing without ""

ERROR: [Errno 99] error while attempting to bind on address ('XY.XY.XY.XY', 7860): cannot assign requested address

i get that error, but i already put an A-Record to the domain which i want, so why does it give me that error?

tingtongdpnw commented 7 months ago

do you have any answer for the error?

jhj0517 commented 6 months ago

seeing this solution would be helpful if you run on the server on AWS. please feel free to re-open it if issue persist.