Skip to content

Commit

Permalink
Update llama-java libs
Browse files Browse the repository at this point in the history
  • Loading branch information
eoctet committed Jan 5, 2024
1 parent 5542f77 commit e56d675
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
10 changes: 5 additions & 5 deletions README.Zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#### 提供
- 简单易用的Java库 `llama-java-core`
- 完整的API服务 `llama-java-app` 用于私有服务
- 完整的API服务 `llama-java-app`
- `服务端部署`,快速实现私有化服务
- `命令行交互`,简单的本地聊天交互

Expand Down Expand Up @@ -65,7 +65,7 @@ bash app_server.sh start
>
> > 完整的API信息请参考[`API 文档`](docs/API.md)
![webui.png](docs%2Fwebui.png)
![webui.png](docs/webui.png)

举个栗子

Expand Down Expand Up @@ -285,7 +285,7 @@ public class ContinuousChatExample {
**chat.octet.model.components.processor.LogitsProcessor**

自定义一个处理器对词的概率分布进行调整,控制模型推理的生成结果。这里是一个示例:[NoBadWordsLogitsProcessor.java](src%2Fmain%2Fjava%2Fchat%2Foctet%2Fmodel%2Fcomponents%2Fprocessor%2Fimpl%2FNoBadWordsLogitsProcessor.java)
自定义一个处理器对词的概率分布进行调整,控制模型推理的生成结果。这里是一个示例:[NoBadWordsLogitsProcessor.java](llama-java-core/src/main/java/chat/octet/model/components/processor/impl/NoBadWordsLogitsProcessor.java)

```java
Map<Integer, String> logitBias = Maps.newLinkedHashMap();
Expand All @@ -300,7 +300,7 @@ public class ContinuousChatExample {

**chat.octet.model.components.criteria.StoppingCriteria**

自定义一个控制器实现对模型推理的停止规则控制,例如:控制生成最大超时时间,这里是一个示例:[MaxTimeCriteria](src%2Fmain%2Fjava%2Fchat%2Foctet%2Fmodel%2Fcomponents%2Fcriteria%2Fimpl%2FMaxTimeCriteria.java)
自定义一个控制器实现对模型推理的停止规则控制,例如:控制生成最大超时时间,这里是一个示例:[MaxTimeCriteria](llama-java-core/src/main/java/chat/octet/model/components/criteria/impl/MaxTimeCriteria.java)

```java
long maxTime = TimeUnit.MINUTES.toMillis(Optional.ofNullable(params.getTimeout()).orElse(10L));
Expand All @@ -311,7 +311,7 @@ public class ContinuousChatExample {
.build();
```

> 完整的文档请参考 [Java docs](docs%2Fapidocs%2Findex.html)
> 完整的文档请参考 `Java docs`
#### 如何编译

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is a 🦙 `LLaMA` Java project. You can use it to deploy your own private s

#### Provides
- Simple Java library `llama-java-core`
- Complete API services `llama-java-app` for private services
- Complete API services `llama-java-app`
- `Server deployment` to quickly realize privatized services
- `CLI Interaction`, simple local chat interaction

Expand Down Expand Up @@ -65,7 +65,7 @@ Following the interface specifications of `ChatGPT`, only the main interfaces ar
>
> > More information: [`API Docs`](docs/API.md).
![webui.png](docs%2Fwebui.png)
![webui.png](docs/webui.png)

For example

Expand Down Expand Up @@ -285,7 +285,7 @@ You can use `LogitsProcessor` and `StoppingCriteria` to customize and control th
**chat.octet.model.components.processor.LogitsProcessor**

Customize a processor to adjust the probability distribution of words and control the generation of model inference results. Here is an example: [NoBadWordsLogitsProcessor.java](src%2Fmain%2Fjava%2Fchat%2Foctet%2Fmodel%2Fcomponents%2Fprocessor%2Fimpl%2FNoBadWordsLogitsProcessor.java)
Customize a processor to adjust the probability distribution of words and control the generation of model inference results. Here is an example: [NoBadWordsLogitsProcessor.java](llama-java-core/src/main/java/chat/octet/model/components/processor/impl/NoBadWordsLogitsProcessor.java)

```java
Map<Integer, String> logitBias = Maps.newLinkedHashMap();
Expand All @@ -300,7 +300,7 @@ Customize a processor to adjust the probability distribution of words and contro

**chat.octet.model.components.criteria.StoppingCriteria**

Customize a controller to implement stop rule control for model inference, such as controlling the maximum timeout time generated. Here is an example: [MaxTimeCriteria](src%2Fmain%2Fjava%2Fchat%2Foctet%2Fmodel%2Fcomponents%2Fcriteria%2Fimpl%2FMaxTimeCriteria.java)
Customize a controller to implement stop rule control for model inference, such as controlling the maximum timeout time generated. Here is an example: [MaxTimeCriteria](llama-java-core/src/main/java/chat/octet/model/components/criteria/impl/MaxTimeCriteria.java)

```java
long maxTime = TimeUnit.MINUTES.toMillis(Optional.ofNullable(params.getTimeout()).orElse(10L));
Expand All @@ -311,7 +311,7 @@ Customize a controller to implement stop rule control for model inference, such
.build();
```

> More information: [Java docs](docs%2Fapidocs%2Findex.html)
> More information: `Java docs`
#### Build

Expand Down
File renamed without changes.
File renamed without changes
5 changes: 3 additions & 2 deletions llama-java-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>chat.octet</groupId>
<artifactId>llama-java</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
</parent>

<artifactId>llama-java-app</artifactId>
Expand Down Expand Up @@ -43,6 +43,7 @@
<lombok.version>1.18.26</lombok.version>
<guava.version>32.1.2-jre</guava.version>
<spring-boot.version>2.7.16</spring-boot.version>
<llama.java.version>1.3.3</llama.java.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -114,7 +115,7 @@
<dependency>
<groupId>chat.octet</groupId>
<artifactId>llama-java-core</artifactId>
<version>1.3.2</version>
<version>${llama.java.version}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
Expand Down
2 changes: 1 addition & 1 deletion llama-java-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>chat.octet</groupId>
<artifactId>llama-java</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
</parent>

<artifactId>llama-java-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>chat.octet</groupId>
<artifactId>llama-java</artifactId>
<packaging>pom</packaging>
<version>1.3.2</version>
<version>1.3.3</version>

<modules>
<module>llama-java-core</module>
Expand Down

0 comments on commit e56d675

Please # to comment.