Signed-off-by: 10-1 <10-1@sairate.top>

This commit is contained in:
10-1 2024-11-09 14:32:45 +08:00
commit c7b6eac715
7 changed files with 90 additions and 0 deletions

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# 默认忽略的文件
/shelf/
/workspace.xml

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

7
.idea/misc.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.12" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (钟淇奕)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/钟淇奕.iml" filepath="$PROJECT_DIR$/.idea/钟淇奕.iml" />
</modules>
</component>
</project>

10
.idea/钟淇奕.iml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.12 (钟淇奕)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

17
11.9.py Normal file
View File

@ -0,0 +1,17 @@
#type()
#int()
#float()
#str()
#bool()
# print(int(1.3453445))
# print(float(2))
# print(str(2))
# print(type(str(2)))
# print(bool(1))
# print(bool(" "))
# a=False
# print(bool(str(a)))
# a=int(input())
# b=int(input())
# c=int(input())
# print(a*2+b*3+c*4)

39
main.py Normal file
View File

@ -0,0 +1,39 @@
from ollama import Client
def get_completion(prompt, model="solar"):
client = Client(host='http://8.130.118.164:11434/')
response = client.chat(model, messages=[
{
'role': 'user',
'content': prompt,
},
])
print(response)
print(response['message'])
return response['message']['content']
print(get_completion("你好,我是小明。"))
# import cv2
# def test_camera():
# video_capture = cv2.VideoCapture(0) # 打开默认摄像头
#
# if not video_capture.isOpened():
# print("无法打开摄像头")
# return
#
# while True:
# ret, frame = video_capture.read()
# if not ret:
# print("无法读取摄像头画面")
# break
#
# cv2.imshow('Video', frame)
#
# if cv2.waitKey(1) & 0xFF == ord('q'): # 按 'q' 键退出
# break
#
# video_capture.release()
# cv2.destroyAllWindows()
#
# # 调用函数
# test_camera()