GithubHelp home page GithubHelp logo

Comments (8)

threeColorFr avatar threeColorFr commented on May 29, 2024

前端网址端口应该是5000吧? 你是什么平台,linux?,看看包的版本之类的?

from chatie.

duxueyuan7802632 avatar duxueyuan7802632 commented on May 29, 2024

感谢回复,我是windows11,后端启动的时候,有个警告,但我觉得不是这个原因吧

: UserWarning: The current Python is not a recommended version, 3.10+ is recommended
import("warnings").warn(

  • Serving Flask app "run" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    前端启动的界面:
    front
    hou后端的运行界面:
    back

from chatie.

threeColorFr avatar threeColorFr commented on May 29, 2024

你现在前后端可以打通吗。能看看具体报错位置在哪行代码和原因吗。

from chatie.

duxueyuan7802632 avatar duxueyuan7802632 commented on May 29, 2024

老师!前端执行没问题,http://localhost:5000/,但clear那个按钮失效。后端一直就not found http://127.0.0.1:3000/ (Press CTRL+C to quit)。当我在前端输入一端文字的时候,就报出我上面截图的错误,完后在后端就有如下错误提示:
"{"sentence":"你好","type":"","access":"","task":"NER","lang":"chinese"}"
<class 'str'>
后端传入数据: {'sentence': '你好', 'type': '', 'access': '', 'task': 'NER', 'lang': 'chinese'}
127.0.0.1 - - [30/Apr/2024 11:13:34] "POST /api/v1/updateStaff HTTP/1.1" 500 -
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Lib\site-packages\flask\app.py", line 2464, in call
return self.wsgi_app(environ, start_response)
File "C:\ProgramData\Anaconda3\Lib\site-packages\flask\app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "C:\ProgramData\Anaconda3\Lib\site-packages\flask\app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\ProgramData\Anaconda3\Lib\site-packages\flask_compat.py", line 39, in reraise
raise value
File "C:\ProgramData\Anaconda3\Lib\site-packages\flask\app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "C:\ProgramData\Anaconda3\Lib\site-packages\flask\app.py", line 1953, in full_dispatch_request
return self.finalize_request(rv)
File "C:\ProgramData\Anaconda3\Lib\site-packages\flask\app.py", line 1968, in finalize_request
response = self.make_response(rv)
File "C:\ProgramData\Anaconda3\Lib\site-packages\flask\app.py", line 2097, in make_response
raise TypeError(
TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.

在run.py代码中,我修改了静态模版和动态模版的路径,也没好使:app = Flask(name, template_folder='../front-end/public', static_folder='../front-end/src'),路径设置的有问题啊?

from chatie.

threeColorFr avatar threeColorFr commented on May 29, 2024

你的意思是前后端可以打通跑出结果,但是clear没用是吗?
这个问题我复现不出来,我之前试的windows上运行也是没问题的。
你看看修改一下port proxy之类的呢。还有你的port有没有开。
截屏2024-04-30 11 31 29

from chatie.

duxueyuan7802632 avatar duxueyuan7802632 commented on May 29, 2024

大佬,跑通了,呵呵!代码问题!
1.可能是我 npm install 之后,直接调试,导致不知名的错误,应该重启电脑,现开启前端,再开启后端。
2.易错的点是KEY,我是买的第三方的key, proxy代理,应该在您 openai.api_base 里面设置,而不是 openai.proxy里面设置。
3.关于clear 按钮,功能没问题,我理解错了,当我跑通了才知道他的作用,他是清理下面的显示,而不是清理输入框的信息。谢谢大佬回复,让我排除了问题!

from chatie.

duxueyuan7802632 avatar duxueyuan7802632 commented on May 29, 2024

from chatie.

ytWu1314 avatar ytWu1314 commented on May 29, 2024

大佬,跑通了,呵呵!代码问题! 1.可能是我 npm install 之后,直接调试,导致不知名的错误,应该重启电脑,现开启前端,再开启后端。 2.易错的点是KEY,我是买的第三方的key, proxy代理,应该在您 openai.api_base 里面设置,而不是 openai.proxy里面设置。 3.关于clear 按钮,功能没问题,我理解错了,当我跑通了才知道他的作用,他是清理下面的显示,而不是清理输入框的信息。谢谢大佬回复,让我排除了问题!

大佬,您的proxy怎么成功的?openai.api_base = "这里要填什么呀?" #或者利用反向代理openai.com(代理获取:https://github.com/justjavac/openai-proxy
(注释掉上面那句代码)

反向代理那个教程我只在deno 弄了一个域名,openai api的key我申请了,但是布吉岛怎么用,是填到df_access = []里面吗?(为啥列表要分成两块?)

Snipaste_2024-05-03_11-10-08

Snipaste_2024-05-03_11-10-46

您整体的流程是咋样的?我到现在还是跑不起来作者的这个项目

from chatie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.